Загрузил файл

This commit is contained in:
Batareiken 2024-02-28 23:26:39 +00:00
parent 54152110b1
commit e3d80ab3b7
1 changed files with 38 additions and 0 deletions

38
jslib/build.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
CURRENTDIR=$(dirname $0)
cd $CURRENTDIR/../htdocs
mkdir -p tmp
#
# Minimize and move to build dir
#
for file in $(find ../jslib/src/ -name '*.js')
do
if [[ ${file} != *".min."* ]];then
newFile="${file##*/}"
newFile="tmp/${newFile//.js/}.min.js"
echo "Processing $file -> $newFile"
python2 -m jsmin $file > $newFile
#cp $file $newFile
else
newFile="tmp/${file##*/}"
echo "Processing $file -> $newFile"
cp $file $newFile
fi
done
#
# Create the full js file
#
cp tmp/trackdirect.min.js public/js/trackdirect.min.js
rm tmp/trackdirect.min.js
# Note that the order is important (may need to start adding digits in beginning of each js-file)
ls -vr tmp/*.js | xargs cat >> public/js/trackdirect.min.js
#
# Remove temp dir
#
rm -R tmp
exit 0