Skip to content

Instantly share code, notes, and snippets.

@joshholt
Created March 19, 2010 06:34
Show Gist options
  • Select an option

  • Save joshholt/337298 to your computer and use it in GitHub Desktop.

Select an option

Save joshholt/337298 to your computer and use it in GitHub Desktop.
task 'build', 'build all of the source files', ->
sourceFiles: ['test.coffee']
fs: require('fs'); sys: require('sys');
seed: require('seed'); coffee: seed.require('coffee-script');
for src in sourceFiles
fs.readFile src, (err, code) ->
compiled: coffee.compile code
fs.writeFile src.replace(/\.coffee/,'.js'), compiled, "utf8", (err) ->
throw err if err
puts "Compiled $src -> ${src.replace(/\.coffee/,'.js')}."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment