Created
December 3, 2016 14:11
-
-
Save re-se/82a2f5d3d1fb814d6247d71ccdf350bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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