Skip to content
/ rerun Public
forked from VojtechVitek/rerun

Re-run command on file system changes

License

Notifications You must be signed in to change notification settings

goware/rerun

 
 

Repository files navigation

rerun: Re-run command on file system changes

Credit for this library goes to https://github.com/VojtechVitek/rerun

Lightweight file-watcher that re-runs given command on FS changes. It has simple CLI and optional config file. By default, it uses 200ms delay, which gives enough time for tools like git to update all directories/files within repository before killing the old process (when you switch branches etc).

In development. Only CLI MVP works right now.

Usage

rerun [-watch DIR...] [-ignore DIR...] -run COMMAND [ARG...]

Examples:

$ rerun -watch ./ -ignore vendor bin -run go run ./cmd/rerun/main.go
$ rerun -watch ./ -ignore vendor bin -run sh -c 'go build -i -o ./bin/rerun ./cmd/rerun/main.go && ./bin/rerun'
$ cd tests && rerun -watch '*_test.go' ../pkg -ignore vendor bin -run go test -run=Test

Installation

go get -u github.com/goware/rerun/cmd/rerun

You might need to download Go first.

api:
  watch:
    - cmd
    - *.go
  ignore:
    - bin
    - *_test.go
  cmd:
    - go run cmd/api/main.go -flags args

test-login:
  name: Test login
  watch:
    - tests/e2e
    - services/auth
    - data
  run:
    - go test -run=Login

Uses fsnotify behind the scenes, so technically it should work on most platforms including Linux, Mac OS and Windows.

License

Licensed under the MIT License.

About

Re-run command on file system changes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.1%
  • Makefile 3.9%