Create a gist now

Instantly share code, notes, and snippets.

chokidar = require("chokidar")
exec = require('child_process').exec
distPath = process.argv[3]
watcher = chokidar.watch process.argv[2],
ignored:/[\/\\]\./,
persistent:true
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