34 lines
785 B
Bash
Executable File
34 lines
785 B
Bash
Executable File
#!/bin/bash
|
|
|
|
source build-config.cfg
|
|
|
|
## Only run npm build if there was a change in a .js or .vue file
|
|
current_md5=$(<last-js-build.md5)
|
|
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
|
|
|
|
new_md5=$(<last-js-build.md5)
|
|
if [ "$current_md5" != "$new_md5" ]
|
|
then
|
|
npm run build
|
|
fi
|
|
### END npm build ###
|
|
|
|
## Compile SASS
|
|
sh compile-sass.sh
|
|
|
|
## Install composer dependencies
|
|
composer install
|
|
|
|
echo "Updating files in $destination"
|
|
rm -rf $destination
|
|
mkdir $destination
|
|
cp -R src/* $destination/
|
|
rm -rf $destination/scss
|