Skip to content

Instantly share code, notes, and snippets.

@cancerberoSgx
Last active April 25, 2018 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cancerberoSgx/b0eff52f0afa178214fef823520b9ae4 to your computer and use it in GitHub Desktop.
Save cancerberoSgx/b0eff52f0afa178214fef823520b9ae4 to your computer and use it in GitHub Desktop.
watch and exec

Using unix command watch for detecting a change in file and executing command:

while true ; do  watch -g -d "cat src/index.ts" && yarn run doc-docco ; done

More refined, this time executes the command first:

CMD="yarn run doc-docco"; eval $CMD ; while true ; do  watch -g -d "cat src/index.ts" && eval $CMD ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment