Skip to content

Commit 6c07259

Browse files
committed
feat(watchexec): ✨ Add an example of watchexec.
1 parent 2951484 commit 6c07259

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

59_monitor_folder/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Demonstrate how to monitor a folder for changes using `inotify` or `watchman`.
44

5-
TODO:
6-
7-
* add watchexec example
8-
95
## Reason
106

117
It's a common requirement that a process needs to monitor the output of another process via the filesystem. File notification systems are generally OS specific.
@@ -16,6 +12,7 @@ It's a common requirement that a process needs to monitor the output of another
1612
(./inotify/README.md)
1713
* Demonstrate how to monitor a folder for changes using `watchman` [here]
1814
(./watchman/README.md)
15+
* Demonstrate how to use [watchexec](./watchexec/README.md)
1916

2017
## Resources
2118

59_monitor_folder/watchexec/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# WATCHEXEC
2+
3+
Demonstrate how to monitor a folder for changes using `watchexec`.
4+
5+
## Install
6+
7+
```sh
8+
just nix
9+
```
10+
11+
## Trigger
12+
13+
```sh
14+
watchexec --exts md cat README.md
15+
#or
16+
just cat
17+
```
18+
19+
## Resources
20+
21+
* watchexec [here](https://watchexec.github.io/)
22+
* watchexec/watchexec repo [here](https://github.com/watchexec/watchexec)

59_monitor_folder/watchexec/justfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env just --justfile
2+
# ^ A shebang isn't required, but allows a justfile to be executed
3+
# like a script, with `./justfile test`, for example.
4+
5+
set dotenv-load := true
6+
7+
# default lists actions
8+
default:
9+
@just -f {{ source_file() }} --list
10+
11+
nix:
12+
@nix-shell -p watchexec --command zsh
13+
14+
cat:
15+
@watchexec --exts md cat README.md

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# 📝 TODO
22

3-
* Watchexec https://github.com/watchexec/watchexec/tree/main/crates/cli#features
43
* code=${PIPESTATUS[0]} -- getting pipestatus codes.
54
* -- end of options https://www.cyberciti.biz/faq/what-does-double-dash-mean-in-ssh-command
65
* fold command - wrap line lengths.

0 commit comments

Comments
 (0)