Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
Update publish.js (#779)
Browse files Browse the repository at this point in the history
fix: fixed some issues related to coercion and logical topics
  • Loading branch information
ali-master authored and FredyC committed Sep 17, 2019
1 parent 039b7db commit b7b2f23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
})
})
}
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b7b2f23

Please sign in to comment.