Skip to content

[Deprecated] Re-execute a given command everytime something changes in a specific directory

Notifications You must be signed in to change notification settings

idobh2/watch-run

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watch-run(1)

Note: Check out wait-run or just-wait for better and more recent approaches.

Re-execute a given command everytime something changes in a specific directory. Build upon gaze.

Installation

$ npm install -g watch-run

Usage

Via --help:

Usage: watch-run <cmd>

Options:

  -h, --help               output usage information
  -p, --pattern <pattern>  glob pattern. "," separates multiple patterns.
                           More info: https://github.com/isaacs/minimatch
  -i, --initial            run <cmd> on initial startup
  -d, --delay <n>          delay execution of <cmd> for a number of milliseconds
  -s, --stop-on-error      stop watching and exit when errors occur in <cmd>

Examples:

  # watch dir and execute cmd
  $ watch-run -p 'lib/**' cat package.json

  # watch dir "lib" and "src" and execute cmd
  $ watch-run -p 'lib/**,src/**' cat package.json

  # watch dir "lib" and "src" and execute cmd, while using the absolute path of the changed file
  $ watch-run -p 'lib/**,src/**' cat {absolute}

  # watch dir "lib" and "src" and execute cmd, while using the relative (to the current workind-dir) path of the changed file
  $ watch-run -p 'lib/**,src/**' cat ./{relative}

Example

$ watch-run -p 'js/modules/**/*.js' browserify main.js -o public/build.js

License

MIT

About

[Deprecated] Re-execute a given command everytime something changes in a specific directory

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.3%
  • Makefile 2.7%