Skip to content

Commit

Permalink
Fix race condition in handing --help
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr committed Sep 12, 2016
1 parent 75d943f commit d0196b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ var args = argv.join(' ');
var command = argv[0];


// (bare call of 'nodist') -> list
if (!argv[0]) {
command = 'list';
}

// -V Display nodist version
if (args.match(/-v/i) !== null) {
Expand All @@ -123,17 +127,13 @@ if (args.match(/-v/i) !== null) {
}

// --HELP Display help
if (args.match(/--help/i)) {
else if (args.match(/--help/i)) {
help();
}

// (bare call of 'nodist') -> list
if (!argv[0]) {
command = 'list';
}

// LIST all installed buids
if (command.match(/^list|ls$/i)) {
else if (command.match(/^list|ls$/i)) {

n.getGlobal(function(err, globalSpec){
n.resolveVersionLocally(globalSpec, function(er, globalVersion) {
Expand Down

0 comments on commit d0196b9

Please sign in to comment.