# 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 }