#!/usr/bin/env node

var exec = require('child_process').exec;
var fs = require('fs');

var coffee_path = 'coffee/'

if( !fs.existsSync(coffee_path)) {
    fs.mkdirSync(coffee_path)
}

exec("coffee --compile --output www/js/ " + coffee_path)

#!/usr/bin/env node

var execSync = require('child_process').execSync;
var fs = require('fs');

var coffee_path = 'coffee/'

if( !fs.existsSync(coffee_path)) {
    fs.mkdirSync(coffee_path)
}

execSync("coffee --compile --output www/js/ " + coffee_path)

Use execSync to avoid race
Use execSync to avoid race

Running coffeescript in the background means that cordova might use
stale output, depending on who is faster.

As an added bonus, throws error if coffeescript exits with a non-zero
return code. Usually, that is because of a syntax error in the
sources.
