Skip to content

Commit

Permalink
bump dependencies, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joemaller committed Oct 20, 2019
1 parent 7e95a49 commit fbfbfcb
Show file tree
Hide file tree
Showing 4 changed files with 1,452 additions and 1,616 deletions.
10 changes: 5 additions & 5 deletions app/get-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(args) {
let jsonFile = fs.readJsonSync(config.package_json);
data = {
path: config.package_json,
pkg: jsonFile
packageJson: jsonFile
};
} catch (err) {
throw new Error(`Unable to load ${config.package_json} ${err}`);
Expand All @@ -34,17 +34,17 @@ module.exports = function(args) {
throw new Error("Unable to find a package.json file.");
}

if (data.pkg && data.pkg.version)
data.pkg.version = semver.clean(data.pkg.version);
if (!data.pkg.version) {
if (data.packageJson && data.packageJson.version)
data.packageJson.version = semver.clean(data.packageJson.version);
if (!data.packageJson.version) {
let relPath = path.relative(process.cwd(), data.path);
throw new Error(
`${relPath} does not contain a valid SemVer version string.`
);
}

log(`Loading ${path.relative(process.cwd(), data.path)}`);
log(`Current version is "${data.pkg.version}"`);
log(`Current version is "${data.packageJson.version}"`);

return data;
};
Loading

0 comments on commit fbfbfcb

Please sign in to comment.