Skip to content

Commit

Permalink
Nicer error message on missing config (#20)
Browse files Browse the repository at this point in the history
* Fix #12: Nicer error message on missing config

* Update import tabling
  • Loading branch information
gigabo authored and hzoo committed Jun 1, 2016
1 parent bdbe01f commit 8d72e8c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Changelog.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import LernaRepo from "lerna/lib/Repository";
import progressBar from "lerna/lib/progressBar";
import RemoteRepo from "./RemoteRepo";
import execSync from "./execSync";
import LernaRepo from "lerna/lib/Repository";
import progressBar from "lerna/lib/progressBar";
import RemoteRepo from "./RemoteRepo";
import execSync from "./execSync";
import ConfigurationError from "./ConfigurationError";

export default class Changelog {
constructor(config) {
Expand All @@ -14,6 +15,13 @@ export default class Changelog {

const config = lerna.lernaJson.changelog;

if (!config) {
throw new ConfigurationError(
"Missing changelog config in `lerna.json`.\n"+
"See docs for setup: https://github.com/lerna/lerna-changelog#readme"
);
}

config.rootPath = lerna.rootPath;

return config;
Expand Down

0 comments on commit 8d72e8c

Please sign in to comment.