Skip to content

Commit

Permalink
Added keepAlive option.
Browse files Browse the repository at this point in the history
Fixed wrong place for check
  • Loading branch information
alansouzati committed Aug 8, 2016
1 parent e296576 commit 4359f43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dist/vorpal.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ Vorpal.prototype.parse = function (argv, options) {
this.exec(args.join(' '), function (err) {
if (err !== undefined && err !== null) {
throw new Error(err);
// Exits the CLI context as the UI is still attached
this.exec('exit');
if (!options.keepAlive) {
// Exits the CLI context as the UI is still attached
this.exec('exit');
}
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion lib/vorpal.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ Vorpal.prototype.parse = function (argv, options) {
this.exec(args.join(' '), function (err) {
if (err !== undefined && err !== null) {
throw new Error(err);
// Exits the CLI context as the UI is still attached
}
if (!options.keepAlive) {
// Exits the CLI context as the UI is still attached
this.exec('exit');
}
});
Expand Down

0 comments on commit 4359f43

Please sign in to comment.