Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (20 sloc) 1.245 kb

Hobbes

Hobbes is a small UNIX-style file watcher for OSX windows, linux and OSX (thanks @cgag), written after experiencing some OSX bugs with my usual standby guard. The filenames of modified files are simply echoed to stdout, one file per line. You take it from there.

Complex tasks can be accomplished by combining hobbes with other commands such as xargs, for example:

# automatic GHC recompile when your source files change
hobbes "*.hs" | xargs -n1 ghc --make

xargs -n1 <command> means essentially "run the command on each word of input". So ghc --make is run on each modified file.

Another example: I have a script called kick that reloads the current tab in Chrome and then refocuses iTerm. With this command to hobbes I get automatic browser reloading on every save. Script here if you're interested.

hobbes "*.html" | xargs -n1 kick

Installation

First install haskell via your system's package manager. On OSX it's as simple as:

brew install haskell-platform

then install hobbes with:

cabal install hobbes

Thanks

Hobbes is a very small wrapper around fsnotify.

Jump to Line
Something went wrong with that request. Please try again.