Skip to content

Instantly share code, notes, and snippets.

@giginet
Created December 22, 2011 07:38
Show Gist options
  • Save giginet/1509393 to your computer and use it in GitHub Desktop.
Save giginet/1509393 to your computer and use it in GitHub Desktop.
sys = require 'sys'
exec = (require 'child_process').exec
FILENAME = 'game' # write your game title.
FILES = [
'src/main.coffee',
'src/player.coffee',
# write sourcecodes here.
]
task 'compile', "compile and minify #{FILENAME}.", (options) ->
outputErr = (err, stdout, stderr) ->
throw err if err
if stdout or stderr
console.log "#{stdout} #{stderr}"
if FILES.length is 1
exec "coffee -c #{FILENAME}.js #{FILES[0]}", outputErr
else
exec "coffee -cj #{FILENAME} #{FILES.join ' '}", outputErr
exec "yuicompressor #{FILENAME}.js > #{FILENAME}.min.js", outputErr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment