watcher

command module
v0.0.0-...-cd6f60b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 9 Imported by: 0

README

simple filesystem watcher and executor

watcher is a simple utility that waits for filesystem activity to execute a command

Example:

In Shell A:

☭ ~ $ go get github.com/tmc/watcher
☭ ~ $ watcher -h
usage: watcher [flags] [command to execute and args]
  -d=1: recursion depth
  -quiet=800: quiet period after command execution in milliseconds
  -v=false: verbose
☭ ~ $ mkdir /tmp/foo; cd /tmp/foo
☭ /tmp/foo $ watcher echo "triggered"
running echo [triggered]
triggered

Now, In Shell B:

☭ ~ $ touch /tmp/foo/oi

Every time /tmp/foo changes the echo will be re-executed.

I use this to run tests, trigger build steps, refresh browsers, etc.

License: ISC

Documentation

Overview

watches the current directory for changes and runs the specificed program on change

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL