Re-run the given command every time files under the current directory areupdated.
Project description
Usage
rerun [options] <command>
where ‘options’ may include:
--verbose|-v List changed files before <command> output --ignore|-i <D> Directory or filename to ignore. Changes to this file do not trigger another execution of <command>.
e.g:
rerun python -m unittest mypackage.mymodule
will rerun your tests every time you save your source code. Handy for seeing the new test results in a console window after you hit ‘save’ in your editor, without having to change window focus.
It detects changes to files by polling file modification times once per second. On detecting any changes, it clears the terminal and reruns the given command.
Polling for modification times perhaps isn’t ideal. Registering of OS-specific notifications of file system events might be better. In practice though, I haven’t noticed it burden my machine, even in project directories containing hundreds of files.
It ignores directories called .svn, .git, .hg, .bzr, build and dist. It ignores files ending with .pyc or .pyo.
Dependencies
Tested on WindowsXP, Windows 7, MacOSX, and Ubuntu.
Runs under Python2.7 or 3.2.
No other dependencies.
Install
pip install rerun
Thanks
The idea came from the Bash command ‘watch’, and inspiration for this implementation came from an old blog post by Jeff Winkler, whos website http://jeffwinkler.net seems to have now died.
Contact
Jonathan Hartley, tartley@tartley.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
File details
Details for the file rerun-1.0.5.beta.zip
.
File metadata
- Download URL: rerun-1.0.5.beta.zip
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73e6b6ecb496087463069157a285414530afe1cc248701d6da115376baeac6a |
|
MD5 | 7359b4d275c7a048e7db252f7daef348 |
|
BLAKE2b-256 | da01c1b48e24f050b0c1ef5cf09ce17159016c000f9c096a9cc070ff106d7b14 |
File details
Details for the file rerun-1.0.5.beta.tar.gz
.
File metadata
- Download URL: rerun-1.0.5.beta.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 276ae6af2ccf7ce683c5ff1b2bc8a2cf16b3549301ace2a1ac20ffb3e7e1b2c1 |
|
MD5 | cc33373985bbe24bc663170586ad03f2 |
|
BLAKE2b-256 | eb915ae116d2dad437e7ec3c74c65130f4f3eaa43b6104a84e18557df7922c83 |