X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fsetup.sh;h=b242dc4ae1e4767f5a35750e9e7883718ea72178;hb=c346b0a8bea99a1ec1f12491ce1fceb74d50a426;hp=5273907a6943f23b9d30f7b2d267fa33a7d405c7;hpb=71b84f9cd93a198d00322ddf2964b2b55482d221;p=civicrm-core.git diff --git a/bin/setup.sh b/bin/setup.sh index 5273907a69..b242dc4ae1 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -151,7 +151,24 @@ if [ -n "$DO_DOWNLOAD" ]; then fi BOWER=$(pickcmd node_modules/bower/bin/bower bower) - #$BOWER install + if [ -f "$BOWER" ]; then + NODE=$(pickcmd node nodejs) + BOWER="$NODE $BOWER" + fi + # Without the force flag, bower may not check for new versions or verify that installed software matches version specified in bower.json + # With the force flag, bower will ignore all caches and download all deps. + if [ -n "$OFFLINE" ]; then + BOWER_OPT= + elif [ ! -f "bower_components/.setupsh.ts" ]; then + ## First run -- or cleanup from failed run + BOWER_OPT=-f + elif [ "bower.json" -nt "bower_components/.setupsh.ts" ]; then + ## Bower.json has changed since last run + BOWER_OPT=-f + fi + [ -f "bower_components/.setupsh.ts" ] && rm -f "bower_components/.setupsh.ts" + $BOWER install $BOWER_OPT + touch bower_components/.setupsh.ts popd fi