https://github.com/fabiosantoscode/inotifydo
Wait for files to change, execute shell command, repeat
https://github.com/fabiosantoscode/inotifydo
Last synced: 10 months ago
JSON representation
Wait for files to change, execute shell command, repeat
- Host: GitHub
- URL: https://github.com/fabiosantoscode/inotifydo
- Owner: fabiosantoscode
- Created: 2013-10-30T01:24:38.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-25T12:59:31.000Z (almost 9 years ago)
- Last Synced: 2025-02-10T21:37:14.404Z (12 months ago)
- Language: Shell
- Size: 5.86 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# inotifydo
This is a tool that watches files for changes, and executes a command when a change happens.
## How to install
This requires the `inotifywait` command to be available in your PATH. (you
need to install `inotify`, possibly in the `inotify-tools` package in your
distro if you're ubuntu-ish)
Clone this repo, and execute as root:
./install.sh
This places inotifydo in your `PATH`.
## How to use
`cd` into the folder where your files are, and then invoke `inotifydo `.
Example incantation:
cd ~/my-program/
inotifydo make all
That's it.
## Details, details.
`inotifydo` watches file events recursively.
3 lines of `sh` and a shebang. Simplicity for the win. May this be useful and help you in your endeavours and stuff like that.
## But I want to run several commands!
Short of creating a shell script and run that, you can:
inotifydo command1 \&\& echo 'Command1 completed!'
Just use `\&\&` instead of `&&`, `\;` instead of `;`, etc.
This can be used to throttle commands executing too fast for your file changes to be done. Just use `sleep 0.1\; your-command` instead of `your-command`.
You can also display a notification on your screen when something is done, or a failure notification otherwise, good for running unit tests.
inotifydo command1 \&\& notify-send "done" \|\| notify-send "fail"
## I don't speak legalese
No warranty.
license: wtfpl