Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maaslalani/crow
Run commands when files change.
https://github.com/maaslalani/crow
Last synced: about 2 months ago
JSON representation
Run commands when files change.
- Host: GitHub
- URL: https://github.com/maaslalani/crow
- Owner: maaslalani
- License: mit
- Created: 2020-07-08T21:34:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T00:23:44.000Z (over 1 year ago)
- Last Synced: 2024-10-16T19:19:30.815Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 13.2 MB
- Stars: 150
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - maaslalani/crow - Run commands when files change. (Go)
- awesome_go_article - 在特定文件发生变化时执行任意命令
README
# Crow
`crow` is a simple command-line utility that lets you run arbitrary commands when certain files change.![Crow Banner](../assets/banner.png)
## Demo
A demonstration of crow being used to re-execute tests every time a file is saved. Also, see other [use cases](#use-cases).![Crow Demo](../assets/crow.gif)
## Installation
### Install with `go install`
```
go install github.com/maaslalani/crow@latest
```### Install from source
Clone this repository and `cd` into it.
```
git clone [email protected]:maaslalani/crow.git && cd crow
```Install `crow` with go install.
```
go install
```Ensure `~/go/bin` is in your `PATH`.
## Usage
```
crow [--watch path] [--ext extensions] command
```
or pipe in a list of filenames to watch from `stdin` from `fd`, `find`, `ls`, `echo`, etc...
```
filenames | crow command
```### Use cases
Use `crow` to run tests once you save `main.go`.
```
crow -w main.go go test ./...
```
```
echo main.go | crow go test ./...
```Automatically restart your server on changes (watches all files in the current directory).
```
crow go run main.go
```Live preview markdown in your terminal with [glow](https://github.com/charmbracelet/glow).
```
crow -w README.md glow README.md
```
```
fd .md | crow glow README.md
```Use `crow` with `!!` to watch files and run the last command.
```bash
crow !!
```## Alternatives
* [entr](https://github.com/eradman/entr/)
* [reflex](https://github.com/cespare/reflex)## Contributing
Pull requests are welcome.## License
[MIT](https://choosealicense.com/licenses/mit/)