Skip to content

Instantly share code, notes, and snippets.

@benjaminparnell
Created October 2, 2015 13:28
Show Gist options
  • Save benjaminparnell/8afe459d40e657142504 to your computer and use it in GitHub Desktop.
Save benjaminparnell/8afe459d40e657142504 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
}
})
})
{
"name": "niks-watcher",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": {
"niks-watcher": "bin"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"chokidar": "^1.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment