watchexec: new cheatsheet

This commit is contained in:
Rico Sta. Cruz 2017-10-18 18:16:22 +08:00
parent 669757869e
commit 2a13f9991c
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 61 additions and 0 deletions

61
watchexec.md Normal file
View File

@ -0,0 +1,61 @@
---
title: Watchexec
layout: 2017/sheet
updated: 2017-10-18
category: CLI
weight: -1
keywords:
- "watchexec --excts js,jsx -- npm test"
- "watchexec --help"
intro: |
[mattgreen/watchexec](https://github.com/mattgreen/watchexec) runs commands whenever certain files change.
---
### Installation
#### OSX
```bash
brew install watchexec
```
#### Rust
```bash
cargo install watchexec
```
For Linux and Windows, get it from [GitHub releases](https://github.com/mattgreen/watchexec).
### Getting started
```bash
watchexec --exts js,jsx -- npm test
```
Runs `npm test` when `js,jsx` files change.
```bash
watchman -w lib -w test -- npm test
```
Runs `npm test` when `lib/` and `test/` files change.
### Other options
#### Flags
| `-c` `--clear` | Clear screen |
| `-r` `--restart` | Restart process if its still running |
#### Options
| `-s` `--signal SIGKILL` | Kill signal to use |
| `-d` `--debounce MS` | Debounce by `MS` milliseconds |
| `-e` `--exts EXTS` | Extensions |
| `-i` `--ignore PATTERN` | Ignore these files |
| `-w` `--watch PATH` | Watch these directories |
## Also see
* [mattgreen/watchexec](https://github.com/mattgreen/watchexec) _(github.com)_