Skip to content

Commit

Permalink
fix(config-lerna-scopes): fix package list get with recent lerna vers…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
QuentinRoy authored and marionebl committed Oct 9, 2017
1 parent 2f5ef25 commit 8f35dae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions @commitlint/config-lerna-scopes/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Repository = require('lerna/lib/Repository');
const PackageUtilities = require('lerna/lib/PackageUtilities');

module.exports = {
utils: {getPackages},
Expand All @@ -8,8 +9,12 @@ module.exports = {
};

function getPackages() {
const repo = new Repository(process.cwd());
return repo.packages
const cwd = process.cwd();
const repository = new Repository(cwd);
return PackageUtilities.getPackages({
packageConfigs: repository.packageConfigs,
rootPath: cwd
})
.map(pkg => pkg.name)
.map(name => (name.charAt(0) === '@' ? name.split('/')[1] : name));
}

0 comments on commit 8f35dae

Please sign in to comment.