Adding sample for Coffeescript too

This commit is contained in:
Arfon Smith
2015-11-19 20:24:23 -06:00
parent 8b9fc4683a
commit 473e5db51f
2 changed files with 18 additions and 0 deletions

View File

@@ -569,6 +569,7 @@ CoffeeScript:
extensions:
- .coffee
- ._coffee
- .cake
- .cjsx
- .cson
- .iced

View File

@@ -0,0 +1,17 @@
fs = require 'fs'
{print} = require 'sys'
{spawn} = require 'child_process'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-o', '.', '.']
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
task 'build', 'Build from source', ->
build()