Skip to content

Instantly share code, notes, and snippets.

@return-none
Created May 1, 2013 12:38
Show Gist options
  • Save return-none/5495075 to your computer and use it in GitHub Desktop.
Save return-none/5495075 to your computer and use it in GitHub Desktop.
Simple build task
fs = require 'fs'
{print} = require 'util'
{spawn} = require 'child_process'
task 'build', 'Build assets/js from src/coffee', ->
coffee = spawn 'coffee', ['-c', '-o', 'assets/js', 'src/coffee']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
print data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment