Skip to content

A simple tool that watches for file modifications and executes a shell command

License

Notifications You must be signed in to change notification settings

denibertovic/watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watcher

A simple tool that watches on inofity events and runs a shell command if a file was modified.

NOTE: For now this uses the hinotify package which will on work on Linux machines. There are currently no plans for supporting Mac OSX or BSD.

Installation

Please see Releases page.

USAGE

watcher --help
watcher - File INotify wathcer

Usage: watcher-exe --file PATH --command COMMAND
  Watches files for changes and executes a command on change

Available options:
  -h,--help                Show this help text
  --file PATH              Absolute path to file to watch for changes
  --command COMMAND        Command to run when file changes

Example use-case

To listen on source code changes and reload a dev web server. (If the dev server doesn't support this already).

Production environment use-case where it can listen on config file changes and reload a process so it gets the new changes.

NOTE: If deployed to any kind of production setting it should be spawned with some kind of supervisor (for example: upstart, systemd, supervisord) so it can respawn the process if it crashed.

How to contribute

Report issues on the Issue tracker: https://github.com/denibertovic/watcher/issues

  1. Install stack

  2. Clone the repo (or fork it first and then clone):

    git clone git@github.com:denibertovic/watcher.git

  3. Build:

    cd watcher && make build

About

A simple tool that watches for file modifications and executes a shell command

Resources

License

Stars

Watchers

Forks

Packages

No packages published