From 72fd770c276fe7b045e473693835c02fb26dc09c Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Tue, 3 Jul 2018 15:18:06 +0200 Subject: [PATCH] B #2238: main.js symlink not recovered after re-building sunstone --- src/sunstone/public/build.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/build.sh b/src/sunstone/public/build.sh index c11b6abc942..b8ba65843cc 100755 --- a/src/sunstone/public/build.sh +++ b/src/sunstone/public/build.sh @@ -5,10 +5,11 @@ set -e #------------------------------------------------------------------------------- usage() { echo - echo "Usage: build.sh [-d] [-c] [-h]" + echo "Usage: build.sh [-d] [-c] [-l] [-h]" echo echo "-d: install build dependencies (bower, grunt)" echo "-c: clean build" + echo "-l: recreate links to main.js" echo "-h: prints this help" } @@ -38,16 +39,24 @@ install_patch() { fi done + if [ "$DO_LINK" = "yes" ]; then + mv -f dist/main.js dist/main.js-var + fi + grunt --gruntfile ./Gruntfile.js sass grunt --gruntfile ./Gruntfile.js requirejs mv -f dist/main.js dist/main-dist.js + if [ "$DO_LINK" = "yes" ]; then + mv dist/main.js-var dist/main.js + fi + } #------------------------------------------------------------------------------- -PARAMETERS="dch" +PARAMETERS="dlch" if [ $(getopt --version | tr -d " ") = "--" ]; then TEMP_OPT=`getopt $PARAMETERS "$@"` @@ -57,6 +66,7 @@ fi DEPENDENCIES="no" CLEAN="no" +DO_LINK="no" eval set -- "$TEMP_OPT" @@ -64,6 +74,7 @@ while true ; do case "$1" in -d) DEPENDENCIES="yes" ; shift ;; -c) CLEAN="yes" ; shift ;; + -l) DO_LINK="yes" ; shift ;; -h) usage; exit 0;; --) shift ; break ;; *) usage; exit 1 ;;