Skip to content

Instantly share code, notes, and snippets.

@EnriqueV
Last active May 5, 2016 02:04
Show Gist options
  • Save EnriqueV/c6f018fbb20aff624de0f4584802ae55 to your computer and use it in GitHub Desktop.
Save EnriqueV/c6f018fbb20aff624de0f4584802ae55 to your computer and use it in GitHub Desktop.
watch gulp task
#! /bin/bash
while true
do
cwd=$(pwd)
FILES=$cwd/src/**/**/* // renplace with your path
current=`date +%s`
for f in $FILES
do
last_modified=`stat -c %Y $f`
if [ $(($current-$last_modified)) -lt 2 ]; then
gulp build-custom // your cgulp command
break;
fi
done
sleep 1s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment