Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

rerun-1.0.3-beta.zip (8.6 kB view details)

Uploaded Source

rerun-1.0.3-beta.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file rerun-1.0.3-beta.zip.

File metadata

  • Download URL: rerun-1.0.3-beta.zip
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rerun-1.0.3-beta.zip
Algorithm Hash digest
SHA256 2bbf88eeefd19d8e4f1a18e31d4c3ce4bcb63b3d2e0ad2d268019cc9ff348565
MD5 785c5f46c419d14af057fc14829496d2
BLAKE2b-256 ba6926c13d33002f5ba883e29625a24fb014d196ba9f95e21d81d66f8b92d3a4

See more details on using hashes here.

File details

Details for the file rerun-1.0.3-beta.tar.gz.

File metadata

  • Download URL: rerun-1.0.3-beta.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rerun-1.0.3-beta.tar.gz
Algorithm Hash digest
SHA256 055baed3c2b3c5716e3966000b5525bde7e01d33bb618e3c58de8b9c185d2fca
MD5 682eeba450704ab736cb13a575e38b5f
BLAKE2b-256 d534cfc9e0a6f9d317bd433f2958e49a9f2f63cd97838063b1ac7222634beaa5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page