https://github.com/vojtechvitek/rerun
Re-run command on file system changes
https://github.com/vojtechvitek/rerun
change command file filewatcher fsnotify inotify run
Last synced: 4 months ago
JSON representation
Re-run command on file system changes
- Host: GitHub
- URL: https://github.com/vojtechvitek/rerun
- Owner: VojtechVitek
- License: mit
- Created: 2017-04-19T20:13:01.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T17:32:13.000Z (over 3 years ago)
- Last Synced: 2025-03-16T19:55:02.147Z (over 1 year ago)
- Topics: change, command, file, filewatcher, fsnotify, inotify, run
- Language: Go
- Homepage:
- Size: 1.65 MB
- Stars: 24
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:
```bash
$ rerun -watch ./ -ignore vendor bin '*.md' -run go run ./cmd/rerun/main.go
```
```bash
$ rerun -watch ./ -ignore vendor bin -run sh -c 'go build -i -o ./bin/rerun ./cmd/rerun/main.go && ./bin/rerun'
```
```bash
$ cd tests && rerun -watch '*_test.go' ../pkg -ignore vendor bin -run go test -run=Test
```
# Installation
```bash
go get -u github.com/goware/rerun/cmd/rerun
```
*You might need to [download Go](https://golang.org/dl/) first.*
```yaml
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](https://github.com/fsnotify/fsnotify) behind the scenes, so technically it should work on most platforms including Linux, Mac OS and Windows.
# License
Licensed under the [MIT License](./LICENSE).