2017-11-06 14:02:51 +00:00
|
|
|
#!/bin/bash
|
2017-10-20 14:30:04 +00:00
|
|
|
|
2017-11-06 14:02:51 +00:00
|
|
|
source build-config.cfg
|
2017-10-20 14:30:04 +00:00
|
|
|
|
2017-12-04 18:34:47 +00:00
|
|
|
## Only run npm build if there was a change in a .js or .vue file
|
|
|
|
current_md5=$(<last-js-build.md5)
|
2018-01-22 11:48:51 +00:00
|
|
|
current_OS=`uname`
|
|
|
|
|
|
|
|
# For macOS (Darwin)
|
|
|
|
if [ $current_OS == "Darwin" ]; then
|
|
|
|
find src -type f \( -name "*.js" -or -name "*.vue" \) -exec md5 {} \; | sort -k 2 | md5 > last-js-build.md5
|
|
|
|
else
|
|
|
|
find src -type f \( -name "*.js" -or -name "*.vue" \) -exec md5sum {} \; | sort -k 2 | md5sum > last-js-build.md5
|
|
|
|
fi
|
|
|
|
|
2017-12-04 18:34:47 +00:00
|
|
|
new_md5=$(<last-js-build.md5)
|
|
|
|
if [ "$current_md5" != "$new_md5" ]
|
|
|
|
then
|
|
|
|
npm run build
|
|
|
|
fi
|
|
|
|
### END npm build ###
|
|
|
|
|
|
|
|
## Compile SASS
|
2017-10-20 14:30:04 +00:00
|
|
|
sh compile-sass.sh
|
2017-12-04 15:56:21 +00:00
|
|
|
|
2017-12-04 18:34:47 +00:00
|
|
|
## Install composer dependencies
|
2017-11-15 00:51:44 +00:00
|
|
|
composer install
|
2017-10-20 14:30:04 +00:00
|
|
|
|
2017-12-04 18:34:47 +00:00
|
|
|
echo "Updating files in $destination"
|
2017-11-24 17:32:27 +00:00
|
|
|
rm -rf $destination
|
2017-10-20 14:30:04 +00:00
|
|
|
mkdir $destination
|
2017-12-01 17:38:55 +00:00
|
|
|
cp -R src/* $destination/
|
2017-10-20 14:30:04 +00:00
|
|
|
rm -rf $destination/scss
|