Skip to content
Permalink
Browse files

[minor] Use proper `scripts:start` syntax

Apparently defaulting to just `script.js` causes Windows to fail hard
(see #402).
  • Loading branch information...
mmalecki committed Mar 7, 2013
1 parent 1b86ef0 commit b1a818cf48b81b000af56bc2c3d2c5f5e97a38fb
Showing with 13 additions and 7 deletions.
  1. +13 −7 lib/jitsu/package.js
@@ -701,14 +701,20 @@ package.runScript = function (pkg, action, callback) {
};

function searchStartScript(dir) {
var scripts = ['bin/server'];
['server', 'app', 'index'].forEach(function (i) {
scripts.push(i + '.js', i + '.coffee');
});
var scripts = ['server', 'app', 'index', 'bin/server'],
script,
i;

for (var i in scripts) {
if (existsSync(path.join(dir, scripts[i]))) {
return scripts[i];
for (i in scripts) {
script = path.join(dir, scripts[i]);
if (existsSync(script)) {
return 'node ' + scripts[i];
}
else if (existsSync(script + '.js')) {
return 'node ' + scripts[i] + '.js';
}
else if (existsSync(script + '.coffee')) {
return 'coffee ' + scripts[i] + '.coffee';
}
}
}

0 comments on commit b1a818c

Please sign in to comment.
You can’t perform that action at this time.