Skip to content

Instantly share code, notes, and snippets.

@cmizony
Last active September 6, 2015 04:13
Show Gist options
  • Save cmizony/43e92b74d6eb69409ea8 to your computer and use it in GitHub Desktop.
Save cmizony/43e92b74d6eb69409ea8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ____ __ __ ___ ________ _ ___ __ __ __ _ _
# / ___| \/ |_ _|__ / _ \| \ | \ \ / / \ \ / /_ _| |_ ___| |__ ___ _ __
# | | | |\/| || | / / | | | \| |\ V / _____ \ \ /\ / / _` | __/ __| '_ \ / _ \ '__|
# | |___| | | || | / /| |_| | |\ | | | |_____| \ V V / (_| | || (__| | | | __/ |
# \____|_| |_|___/____\___/|_| \_| |_| \_/\_/ \__,_|\__\___|_| |_|\___|_|
#
#
# Linux: apt-get install inotifywait
#
PROJECT=~/Documents/MyProject # 1. Project watched
type -P inotifywait &>/dev/null || { echo "inotifywait command not found."; exit 1; }
cd $PROJECT
while true
do
grunt jshint # 2. List of shell
grunt jscs # commands to execute
inotifywait -r -q -e modify,attrib,close_write,move,create,delete \
--format '%T %:e %f' --timefmt '%c' \
app/ # 3. List of folders to watch
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment