Run things when stuff changes
Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
main.go

README.md

fswatch

A simple file watcher for the command line. It takes a path to watch and a command to execute when that file is changed (write events only), with the file name as the argument.

Installation

go get github.com/ecix/fswatch

Usage

# watch all files in a directory `mydir` and print their names on change
fswatch -dir mydir -cmd echo
# alternatively omit the command and use a pipe
fswatch -dir mydir | cat

Please not when you use the piping option a newline will be appended to the name of the file.

Contributors

Written by Veit Heller of Port Zero on behalf of ecix.


Have fun!