watchfs

Created: 2014-05-18 19:46
Updated: 2016-11-28 14:17
License: other
go

README.md

WatchFS

WatchFS is a tool that monitors file system for changes and runs specified command after the change.

Install

The tool can be installed using "go get" command:

  $ go get -u github.com/igm/watchfs

Usage

Simple notification after any change on the file system:

  $ watchfs echo "change!!!"

As the original purpose of this tool was to execute go tests automatically after the source code change the format to filter notification for *.go files can following:

  $ watchfs -f "\.go$" go test 

To specify a different time wait period after a change (or set of changes) occurs use timeout parameter:

  $ watchfs -t 250ms go test

For the full ist of available parameters and the defaults run command without any parameters:

  $ watchfs

Limitations

Current version supports shallow directory monitoring only. Recursive file system monitoring is not supported.

Timeout

Usually file system emits several various events when editing a file in a editor. For that purpose timeout parameter defines how long to wait before executing the command. The wait period starts again after any filesystem event.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more