The-Backbone-Store/bin/autoreload

22 lines
487 B
Plaintext
Raw Normal View History

#!/bin/env coffee
2016-04-15 22:06:16 +00:00
fs = require 'fs'
Inotify = require('inotify').Inotify
spawn = require('child_process').spawn
spew = (data) -> console.log data.toString 'utf8'
server = spawn './node_modules/http-server/bin/http-server', ['./htdocs/']
server.stdout.on 'data', spew
monitor = new Inotify()
reBuild = ->
maker = spawn 'make', ['store']
maker.stdout.on 'data', spew
2016-04-15 22:06:16 +00:00
monitor.addWatch
path: "./src/backbonestore.nw"
watch_for: Inotify.IN_CLOSE_WRITE
callback: reBuild