attract/gulp
Sybren A. Stüvel c0cc4547c2 Made ./gulp not always do "gulp watch".
Still allows "./gulp watch" though, which does "gulp && gulp watch".
Also allows for "./gulp --production", which we need during deployment.
2016-09-29 16:49:56 +02:00

20 lines
377 B
Bash
Executable File

#!/bin/bash -ex
GULP=./node_modules/.bin/gulp
function install() {
npm install
touch $GULP # installer doesn't always touch this after a build, so we do.
}
# Rebuild Gulp if missing or outdated.
[ -e $GULP ] || install
[ gulpfile.js -nt $GULP ] && install
if [ "$1" == "watch" ]; then
# Treat "gulp watch" as "gulp && gulp watch"
$GULP
fi
exec $GULP "$@"