TeaWeb/shared/css/generate_packed.sh

80 lines
2.4 KiB
Bash
Raw Normal View History

2019-08-30 21:06:39 +00:00
#!/usr/bin/env bash
cd $(dirname $0)
#find css/static/ -name '*.css' -exec cat {} \; | npm run csso -- --output `pwd`/generated/static/base.css
2019-10-26 00:34:37 +00:00
2019-08-30 21:06:39 +00:00
#File order
files=(
2019-10-26 00:38:40 +00:00
"css/static/properties.css"
2019-08-30 21:06:39 +00:00
"css/static/main-layout.css"
2019-10-26 00:38:40 +00:00
"css/static/general.css"
2019-08-30 21:06:39 +00:00
"css/static/channel-tree.css"
2019-10-26 00:34:37 +00:00
"css/static/connection_handlers.css"
"css/static/context_menu.css"
"css/static/control_bar.css"
"css/static/frame-chat.css"
2019-10-26 00:38:40 +00:00
"css/static/server-log.css"
"css/static/scroll.css"
2019-10-26 00:34:37 +00:00
"css/static/helptag.css"
"css/static/hostbanner.css"
"css/static/htmltags.css"
"css/static/menu-bar.css"
"css/static/mixin.css"
2019-10-26 00:38:40 +00:00
"css/static/modal.css"
2019-08-30 21:06:39 +00:00
"css/static/modals.css"
"css/static/modal-about.css"
"css/static/modal-avatar.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-banclient.css"
"css/static/modal-banlist.css"
2019-08-30 21:06:39 +00:00
"css/static/modal-bookmarks.css"
"css/static/modal-channel.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-channelinfo.css"
2019-08-30 21:06:39 +00:00
"css/static/modal-clientinfo.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-connect.css"
"css/static/modal-group-assignment.css"
"css/static/modal-icons.css"
2019-08-30 21:06:39 +00:00
"css/static/modal-identity.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-invite.css"
2019-08-30 21:06:39 +00:00
"css/static/modal-keyselect.css"
"css/static/modal-permissions.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-playlist.css"
"css/static/modal-poke.css"
"css/static/modal-query.css"
"css/static/modal-server.css"
"css/static/modal-musicmanage.css"
2019-10-26 00:34:37 +00:00
"css/static/modal-serverinfobandwidth.css"
"css/static/modal-serverinfo.css"
"css/static/modal-settings.css"
"css/static/modal-volume.css"
"css/static/overlay-image-preview.css"
2019-10-26 00:34:37 +00:00
"css/static/ts/tab.css"
"css/static/ts/chat.css"
"css/static/ts/icons.css"
"css/static/ts/icons_em.css"
"css/static/ts/country.css"
2019-08-30 21:06:39 +00:00
"css/static/music/info_plate.css"
"css/static/frame/SelectInfo.css"
)
target_file=`pwd`/../generated/static/base.css
2019-09-01 15:24:06 +00:00
if [[ ! -d $(dirname ${target_file}) ]]; then
echo "Creating target path ($(dirname ${target_file}))"
mkdir -p $(dirname ${target_file})
if [[ $? -ne 0 ]]; then
echo "Failed to create target path!"
exit 1
fi
fi
2019-08-30 21:06:39 +00:00
echo "/* Auto generated merged CSS file */" > ${target_file}
for file in "${files[@]}"; do
if [[ ${file} =~ css/* ]]; then
file="./${file:4}"
fi
cat ${file} >> ${target_file}
done
cat ${target_file} | npm run csso -- --output `pwd`/../generated/static/base.css