Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coffee support #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions bin/spark
Expand Up @@ -20,6 +20,13 @@ var child_process = require('child_process'),
cwd = process.cwd(),
net = require('net');

/**
* Coffee script support
* Try to require coffee script, ignore if it fails.
*/
var coffee_script;
try { coffee_script = require('coffee-script') } catch (e) {}

/**
* Framework version.
*/
Expand Down Expand Up @@ -253,6 +260,12 @@ function getAppPath() {
} else if (exists(path + 'server.js')) {
log('detected server.js');
path += 'server';
} else if (coffee_script && exists(path + 'app.coffee')) {
log('detected app.coffee');
path += 'app';
} else if (coffee_script && exists(path + 'server.coffee')) {
log('detected server.coffee');
path += 'server';
} else {
abort('app not found, pass a module path, or create {app,server}.js');
}
Expand Down