From b7b2f23402177bad92cd9d123d0167d335fc9ab1 Mon Sep 17 00:00:00 2001 From: Ali Torki Date: Tue, 17 Sep 2019 11:34:26 +0430 Subject: [PATCH] Update publish.js (#779) fix: fixed some issues related to coercion and logical topics --- publish.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/publish.js b/publish.js index d2662468..129c3242 100755 --- a/publish.js +++ b/publish.js @@ -15,7 +15,7 @@ const rl = readline.createInterface({ function run(command, options) { const continueOnErrors = options && options.continueOnErrors const ret = shell.exec(command, options) - if (!continueOnErrors && ret.code !== 0) { + if (!continueOnErrors && ret.code) { shell.exit(1) } return ret @@ -30,7 +30,7 @@ async function prompt(question, defaultValue) { return new Promise(resolve => { rl.question(`${question} [${defaultValue}]: `, answer => { answer = answer && answer.trim() - resolve(answer ? answer : defaultValue) + resolve(answer || defaultValue) }) }) } @@ -58,7 +58,7 @@ async function main() { //package is registered in npm? var publishedPackageInfo = JSON.parse(npmInfoRet.stdout) if ( - publishedPackageInfo.versions == version || + publishedPackageInfo.versions === version || publishedPackageInfo.versions.includes(version) ) { exit(2, "Version " + pkg.version + " is already published to npm")