public
Created

the output of fs.watchFile when I save a .coffee file

  • Download Gist
compile.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 
{spawn} = require 'child_process'
{print} = require 'util'
fs = require 'fs'
 
coffee_file = 'convert.coffee'
coffee_eval = 'run/eval.coffee'
jade_file = 'html.jade'
stylus_file = 'page.styl'
 
fs.watchFile coffee_file, (e) ->
result = spawn 'coffee', ['-bc', coffee_file]
msg = ''
result.stderr.on 'data', (str) ->
msg+= str
result.stderr.on 'end', ->
console.log 'msg: ', msg
print "!! #{coffee_file}\n"
 
fs.watchFile coffee_eval, (e) ->
result = spawn 'coffee', ['-bc', coffee_eval]
msg = ''
result.stderr.on 'data', (str) ->
msg+= str
result.stderr.on 'end', ->
console.log 'msg: ', msg
print "!! #{coffee_eval}\n"
 
fs.watchFile jade_file, ->
spawn 'jade', [jade_file]
print "!! #{jade_file}\n"
 
fs.watchFile stylus_file, ->
spawn 'stylus', [stylus_file]
print "!! #{stylus_file}\n"
output.log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
$ coffee compile.coffee
{ dev: 2053,
ino: 5767525,
mode: 33204,
nlink: 1,
uid: 1000,
gid: 1000,
rdev: 0,
size: 0,
blksize: 4096,
blocks: 0,
atime: Sun, 06 May 2012 08:20:14 GMT,
mtime: Sun, 06 May 2012 10:41:41 GMT,
ctime: Sun, 06 May 2012 10:41:41 GMT }
!! convert.coffee
{ dev: 2053,
ino: 5767525,
mode: 33204,
nlink: 1,
uid: 1000,
gid: 1000,
rdev: 0,
size: 12657,
blksize: 4096,
blocks: 32,
atime: Sun, 06 May 2012 08:20:14 GMT,
mtime: Sun, 06 May 2012 10:41:41 GMT,
ctime: Sun, 06 May 2012 10:41:41 GMT }
!! convert.coffee
msg:
msg:

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.