Skip to content
Browse files

Update owatch to use 'oextract', and add some basic logging.

  • Loading branch information...
1 parent 046a407 commit 4542cd96f3d159aced2d9839f6640c0b631b99e0 @af af committed Apr 16, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 bin/owatch
View
14 bin/owatch
@@ -1,12 +1,18 @@
#!/usr/bin/env coffee
+dirName = process.cwd() + '/bloqs'
fs = require("fs")
-finder = require("findit").find(process.cwd() + "/bloqs")
+finder = require("findit").find(dirName)
exec = require('child_process').exec
-watchit = (filename) ->
+console.log 'Watching for bloq changes in ' + dirName
+
+watchit = (filename) ->
fs.watchFile filename, (curr, prev) ->
if curr.mtime > prev.mtime
- exec('extract')
-
+ process.stdout.write 'Running oextract...' # Using stdout.write to avoid the linebreak
+ exec('oextract', ->
+ console.log 'done'
+ )
+
finder.on('file', watchit)

0 comments on commit 4542cd9

Please sign in to comment.
Something went wrong with that request. Please try again.