From 7ca316df9472c6b873a7d11fdc18088c372adfaf Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 30 Jan 2016 00:11:31 +0000 Subject: [PATCH] fix check for production build --- build | 2 +- scripts/build-js.sh | 8 ++++---- scripts/build-less.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build b/build index 2e4f989..f5c7ba6 100755 --- a/build +++ b/build @@ -12,7 +12,7 @@ npm run build $@ env/bin/python manage.py collectstatic --noinput -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">> Running Migrations..." env/bin/python manage.py migrate diff --git a/scripts/build-js.sh b/scripts/build-js.sh index 8d819ec..825615d 100755 --- a/scripts/build-js.sh +++ b/scripts/build-js.sh @@ -2,14 +2,14 @@ set -e -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">>> WARNING: Building in Production Mode!" fi mkdir -p static/build/js/lib -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">> Compressing Libraries..." uglifyjs node_modules/bootstrap/dist/js/bootstrap.js --compress --screw-ie8 --define --stats --keep-fnames -o static/build/js/lib/bootstrap.js @@ -22,7 +22,7 @@ fi rm -rf static/build/js/lib -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">> Compressing jQuery..." uglifyjs node_modules/jquery/dist/jquery.js --compress --screw-ie8 --define --stats --keep-fnames -o static/build/js/jquery.js @@ -35,7 +35,7 @@ fi echo ">> Building Application JS..." browserify -t [ babelify --presets [ es2015 react ] ] static/src/js/app.js -o static/build/js/app.js -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">> Compressing Application..." uglifyjs static/build/js/app.js --compress --screw-ie8 --define --stats --keep-fnames -o static/build/js/app.js diff --git a/scripts/build-less.sh b/scripts/build-less.sh index 3eaaef3..7502bfa 100755 --- a/scripts/build-less.sh +++ b/scripts/build-less.sh @@ -2,7 +2,7 @@ set -e -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">>> WARNING: Building in Production Mode!" fi @@ -10,7 +10,7 @@ fi echo ">> Building LESS..." lessc --silent static/src/less/style.less static/build/css/style.css -if [ $BUILD_PRODUCTION == "true" ] +if [[ $BUILD_PRODUCTION ]] then echo ">> Compressing LESS..." cleancss -d --s0 -o static/build/css/style.css static/build/css/style.css