Skip to content

Commit

Permalink
Made package robust against pkginfo errors (#97)
Browse files Browse the repository at this point in the history
* make args robust against pkginfo error

* accomodate linting
  • Loading branch information
dotob authored and leo committed Jul 16, 2017
1 parent da67e92 commit 80b486b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,14 @@ module.exports = {

checkVersion(parent) {
// Load parent module
pkginfo(parent);
try {
pkginfo(parent);
} catch (err) {
// Do nothing, but version could not be aquired
}

// And get its version propery
const version = parent.exports.version;
// And get its version property
const version = parent.exports.version || '-/-';

if (version) {
// If it exists, register it as a default option
Expand Down

0 comments on commit 80b486b

Please sign in to comment.