Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
chokidar = require("chokidar")
exec = require('child_process').exec
distPath = process.argv[3]
watcher = process.argv[2],
watcher.on 'ready', ->
watcher.on 'add', (path) ->
console.log "#{path} added"
watcher.on 'change', (path) ->
console.log "#{path} changed"
exec "qlmanage -t #{path} -s 3000 -o #{distPath}", (err, res) ->
console.log err if err?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment