Skip to content

Instantly share code, notes, and snippets.

@robflaherty
Created August 6, 2011 23:14
Show Gist options
  • Save robflaherty/1129871 to your computer and use it in GitHub Desktop.
Save robflaherty/1129871 to your computer and use it in GitHub Desktop.
CoffeeScript and Stylus watch/build cakefile
# CoffeeScript and Stylus watch/build cakefile
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args...) ->
proc = spawn name, args
proc.stderr.on 'data', (buffer) -> console.log buffer.toString()
proc.stdout.on 'data', (buffer) -> console.log buffer.toString()
proc.on 'exit', (status) -> process.exit(1) if status isnt 0
runCommand 'coffee', '-wc', '-o', 'app/build/', 'app/src/'
runCommand 'stylus', '-w', 'app/src', '-o', 'app/build'
@skw
Copy link

skw commented Apr 10, 2013

Seems to work well with a couple of mods thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment