joh/when-changed
joh/when-changed has 1,227 GitHub stars and 103 forks. Star changes are not measured yet. Last checked 2026-11-09 07:38 UTC. Last push 2024-04-02.
Execute a command when a file is changed
Measured star growth
- in 24h
- Update delayed
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalwhen-changed: Run a command when a file is changed
What is it?
Tired of switching to the shell to test the changes you just made to your code? Starting to feel like a mindless drone, manually running pdflatex for the 30th time to see how your resume now looks?
Worry not, when-changed is here to help! Whenever it sees that you have changed the file, when-changed runs any command you specify.
So to generate your latex resume automatically, you can do this:
$ when-changed CV.tex pdflatex CV.tex
Sweetness!
What do I need?
- Python 2.6+
- watchdog
Installation
pip install https://github.com/joh/when-changed/archive/master.zip
Usage
when-changed [OPTION] FILE COMMAND...
when-changed [OPTION] FILE [FILE ...] -c COMMAND
FILE can be a directory. Use %f to pass the filename to the command.
Options:
- -r Watch recursively
- -v Verbose output. Multiple -v options increase the verbosity. The maximum is 3: -vvv.
- -1 Don't re-run command if files changed while command was running
- -s Run command immediately at start
- -q Run command quietly
Environment variables:
when-changed provides the following environment variables:
WHEN_CHANGED_EVENT: reflects the current event type that occurs. Could be either:
- file_created
- file_modified
- file_moved
- file_deleted
WHEN_CHANGED_FILE: provides the full path of the file that has generated the event.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,586 starspublic-apis/public-apis
A collective list of free APIs
497,902 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
449,631 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,303 stars