Skip to content

Commit

Permalink
[minor] Use proper scripts:start syntax
Browse files Browse the repository at this point in the history
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 b1a818c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lib/jitsu/package.js
Expand Up @@ -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';
}
}
}
Expand Down

0 comments on commit b1a818c

Please sign in to comment.