Created
December 22, 2011 07:38
-
-
Save giginet/1509393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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