-
-
Save rightfold/ffab5c9d30ef486299be 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
#!/usr/bin/env coffee | |
glob = require('glob') | |
path = require('path') | |
LESS_FILES = ['static/css/style.less'] | |
COFFEE_FILES = glob.sync('static/js/**/*.coffee') | |
DEBUG_MODE = '--debug' in process.argv[1..] | |
console.log """ | |
builddir = build | |
""" | |
console.log """ | |
rule lessc | |
command = lessc #{if DEBUG_MODE then '-O0' else '-O2'} $in $out | |
rule coffee | |
command = coffee -p $in > $out | |
""" | |
for less_file in LESS_FILES | |
console.log """ | |
build $builddir/#{less_file}.css: lessc #{less_file} | |
""" | |
for coffee_file in COFFEE_FILES | |
console.log """ | |
build $builddir/#{coffee_file}.js: coffee #{coffee_file} | |
""" |
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
coffee configure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment