Skip to content

Instantly share code, notes, and snippets.

@benjaminparnell
Created October 2, 2015 13:21
Show Gist options
  • Select an option

  • Save benjaminparnell/cb2a585eb930dc9311a8 to your computer and use it in GitHub Desktop.

Select an option

Save benjaminparnell/cb2a585eb930dc9311a8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var chokadir = require('chokidar')
var exec = require('child_process').exec
chokadir.watch('./src').on('change', function () {
console.log('Got a change, running lein run')
exec('lein run', { cwd: process.cwd() }, function (err, stdout, stderr) {
if (err || stderr) {
throw err || stderr
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment