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

Commit

Permalink
fix: πŸ› fix: don't fail if config missing in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 18, 2018
1 parent 60787d2 commit a4a010d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/getConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ const findOverrides = (root) => {
const pkgFilename = path.join(dir, 'package.json');

if (fs.existsSync(pkgFilename)) {
const changelog = require(pkgFilename).config.commitizen.changelog;

if (changelog) {
return changelog;
}
} else {
signale.error('package.json not found, at ' + pkgFilename);
try {
const changelog = require(pkgFilename).config.commitizen.changelog;

if (changelog) {
return changelog;
}
// eslint-disable-next-line no-empty
} catch (error) {}
}

return {};
Expand Down

0 comments on commit a4a010d

Please sign in to comment.