-
-
Save 8secz-johndpope/04c8a5e8a107f32b404ebcdb085b1675 to your computer and use it in GitHub Desktop.
JSLint watch without gulp or grunt
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
# Ubuntu: apt-get intall entr | |
jslint-watch() { | |
local folder=$(test "x$1" != x && echo "$1" || echo .) | |
local files="find $folder -type f -name '*.js'" | |
local modified='$('"$files"' -printf "%T+ %p\n" | sort -r | head -1 | cut -d" " -f2)' | |
eval $files | entr sh -c 'jslint '"$modified"' --color' | |
} | |
# MacOS: brew install entr | |
jslint-watch() { | |
local folder=$(test "x$1" != x && echo "$1" || echo .) | |
find "$folder" -type f -name '*.js' | entr jslint /_ --color | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment