Skip to content

watch for file changes (matching a suffix whitelist) in a directory tree and run a command when they change

License

Notifications You must be signed in to change notification settings

jsleeio/watchspawn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watchspawn

what is it?

Watches for file creates and writes in and below the current directory and when any of them (matching a suffix list) change, runs a command.

Command execution is damped somewhat by a short minimum "idle" time (250ms default) to ensure duplicate (Vim does this) or batched writes do not cause extra useless executions.

usage

Pretty simple. Say you were working on a Go project in your editor --- open a(nother) terminal and:

watchspawn go build

That's it!

options

$ ./watchspawn -help
usage: ./watchspawn [options] COMMAND [ARGS...]

options:
  -min-wait duration
      delay command execution after interesting events (default 250ms)
  -suffixes string
      comma-separated list of interesting filename suffixes (default "go,mod,sum")

key bindings

Vi key bindings (h/j/k/l/g/G and ^F/^B) scroll output text if required.

bugs / room for improvement

  • commands that don't generate output (like a successful Go build) result in no visible feedback, so you can't see if they're finished or not
  • q to quit doesn't actually work; I need to understand tview better. Ctrl-C (twice) does work, though.

About

watch for file changes (matching a suffix whitelist) in a directory tree and run a command when they change

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages