Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
fix(cli): Don't set appVersion to empty string
Browse files Browse the repository at this point in the history
The read-pkg-up module normalises the data in package.json, which means that if version is missing
it gets set to "" (empty string). This causes issues with source maps not matching notifier app
versions, because a missing appVersion != "".
  • Loading branch information
bengourley committed Dec 14, 2018
1 parent 3dd39d6 commit 902cf62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ Promise.resolve()
readPkgUp(conf.projectRoot || process.cwd())
.then(arg => {
const pkg = arg && arg.pkg ? arg.pkg : null;
if (pkg) conf.appVersion = pkg.version;
// only use pkg.version if it's truthy, because read-pkg-up will
// set it to "" (empty string) when it's missing
if (pkg && pkg.version) conf.appVersion = pkg.version;
})
);
}
Expand Down

0 comments on commit 902cf62

Please sign in to comment.