Last active
July 19, 2016 16:33
-
-
Save zph/ce9944e1689b8f2ad58a64eb5c244ff7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ ! -x $(which fswatch) ]];then | |
echo "Must install fswatch" | |
exit 1 | |
fi | |
main(){ | |
DIR_OR_FILE=$1 | |
shift | |
CMD="$@" | |
fswatch -or ${DIR_OR_FILE} | xargs -n1 -I{} -- ${CMD} | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment