Skip to content
Browse files

Don't duplicate default values, trust the defaults or the command line.

The default values are already supplied to Optimist. If something goes wrong,
complain about it rather than reverting to the safe defaults.
  • Loading branch information...
1 parent 4aa25fe commit 1efbf22bf358d5770de0bbadf807b46958cadf7b @StanAngeloff committed Dec 10, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/lotte.js
View
10 lib/lotte.js
@@ -23,7 +23,7 @@ function exec(command, resume) {
function mktemp(options, resume) {
options.garbage || (options.garbage = []);
- exec((options.mktemp || 'mktemp') + ' -t ' + __basename + '.XXXXXX', function(e, stdout) {
+ exec((options.mktemp) + ' -t ' + __basename + '.XXXXXX', function(e, stdout) {
if (e) {
return resume(e);
}
@@ -100,7 +100,7 @@ function process_(options, resume) {
console.error.exception(e);
return resume(e);
}
- queue(parseInt(options.concurrent, 10) || 4, template, options, resume);
+ queue(parseInt(options.concurrent, 10), template, options, resume);
});
};
@@ -207,7 +207,7 @@ function processOne(file, template, options, resume) {
};
function launch(file, options, resume) {
- var phantom = childProcess.spawn(options.phantom || 'phantom', [
+ var phantom = childProcess.spawn(options.phantom, [
"--cookies-file=" + options.cache.cookieFile,
'--ignore-ssl-errors=yes',
'--local-to-remote-url-access=yes',
@@ -239,7 +239,7 @@ function launch(file, options, resume) {
phantom.kill(signal);
resume(new Error("Process '" + pid + "' terminated with '" + signal + "', timed out"), null, buffers);
}
- }, parseInt(options.timeout, 10) || 30000);
+ }, parseInt(options.timeout, 10));
};
function cleanup(options, resume) {
@@ -259,7 +259,7 @@ function cleanup(options, resume) {
function toJavaScript(options, file, resume) {
if (/\.coffee$/i.exec(file)) {
- exec((options.coffee || 'coffee') + ' -p "' + file + '"', function(e, stdout) {
+ exec((options.coffee) + ' -p "' + file + '"', function(e, stdout) {
if (e) {
return resume(e);
}

0 comments on commit 1efbf22

Please sign in to comment.
Something went wrong with that request. Please try again.