From ef7d2c8b0b1efb0f2a063a08785e4ed0c4a1ecc8 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Tue, 11 Sep 2018 16:17:26 +0100 Subject: [PATCH] fix: ipns publish resolve option overwritten (#1556) --- src/cli/commands/name/publish.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/name/publish.js b/src/cli/commands/name/publish.js index 2031ddbc7b..34507c50a6 100644 --- a/src/cli/commands/name/publish.js +++ b/src/cli/commands/name/publish.js @@ -9,6 +9,7 @@ module.exports = { builder: { resolve: { + alias: 'r', describe: 'Resolve given path before publishing. Default: true.', default: true }, @@ -29,8 +30,16 @@ module.exports = { }, handler (argv) { + // yargs-promise adds resolve/reject properties to argv + // resolve should use the alias as resolve will always be overwritten to a function + let resolve = true + + if (argv.r === false || argv.r === 'false') { + resolve = false + } + const opts = { - resolve: argv.resolve, + resolve, lifetime: argv.lifetime, key: argv.key, ttl: argv.ttl