Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loov/watchrun
Watch your files and run your programs.
https://github.com/loov/watchrun
Last synced: 2 days ago
JSON representation
Watch your files and run your programs.
- Host: GitHub
- URL: https://github.com/loov/watchrun
- Owner: loov
- License: mit
- Created: 2015-12-22T11:00:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T10:24:19.000Z (3 months ago)
- Last Synced: 2024-12-31T08:12:15.065Z (9 days ago)
- Language: Go
- Size: 3.76 MB
- Stars: 88
- Watchers: 6
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
`watchrun` is a command-line utility to monitor a directory and run a command
when any file in that directory changes. It excludes temporary and hidden files
that start with `.` or `~` or end with `~`.To install from source:
```
go get github.com/loov/watchrun
```Example usage:
```
$ watchrun "go build -o example.exe . == ./example.exe"
```_Note: directly using `watchrun go run main.go`, doesn't kill the compiled program automatically, which may cause problems, if you have a server listening._
Then you can test with:
```
$ echo package main; main(){ println("hello") } > main.go
$ echo package main; main(){ println("world") } > main.go
```You can explicitly specify which folder or file to watch with `-monitor`:
```
$ watchrun -monitor ../../ "go build -o example.exe . == ./example.exe"
$ watchrun -monitor main.go "go build -o example.exe . == ./example.exe"
```You can run multiple commands in succession with `==` (instead of the usual `&&`). For example:
```
$ watchrun go build -i . == myproject
```## Usage
```
Usage of watchrun:
-ignore string
ignore files/folders that match these globs (default "~*;.*;*~;*.exe")
-interval duration
interval to wait between monitoring (default 300ms)
-monitor string
files/folders/globs to monitor (default ".")
-recurse
when watching a folder should recurse (default true)
-verbose
verbose output
```