Skip to content

Commit

Permalink
Fix promise handling when displaying help
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Jun 6, 2020
1 parent 06ca4a4 commit 96f558e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Expand Up @@ -49,6 +49,7 @@ function help() {
" hash-pw - Creates a hash to use for Node-RED settings like \"adminAuth\"\n"
;
console.log(helpText);
return Promise.resolve();
}

module.exports = function(args) {
Expand All @@ -63,14 +64,14 @@ module.exports = function(args) {
config.init(argv.u||argv.userDir);
}
if (argv.h || argv.help || argv['?']) {
result.help(commands[command]);
return result.help(commands[command]);
} else {
return commands[command](argv,result).catch(err => {
result.warn(err);
throw err;
});
}
} else {
help();
return help();
}
};
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "node-red-admin",
"version": "0.2.5",
"version": "0.2.6",
"description": "The Node-RED admin command line interface",
"homepage": "http://nodered.org",
"bugs": {
Expand Down

0 comments on commit 96f558e

Please sign in to comment.