fix(lerna): Use packages path from lerna.json (#542)

This commit is contained in:
Rhys Arkins 2017-07-27 22:15:50 +02:00 committed by GitHub
parent 434def2bf4
commit 984b5a89b8
2 changed files with 4 additions and 3 deletions

View file

@ -36,7 +36,8 @@ async function checkForLerna(config) {
}
config.logger.debug({ lernaJson }, 'Found lerna config');
try {
const lernaPackages = await config.api.getSubDirectories('packages');
const packagesPath = lernaJson.packages[0].slice(0, -2);
const lernaPackages = await config.api.getSubDirectories(packagesPath);
if (lernaPackages.length === 0) {
return {};
}

View file

@ -59,7 +59,7 @@ describe('workers/repository/apis', () => {
it('ignores zero length lerna', async () => {
const config = {
api: {
getFileJson: jest.fn(() => ({})),
getFileJson: jest.fn(() => ({ packages: ['packages/*'] })),
getSubDirectories: jest.fn(() => []),
},
logger,
@ -70,7 +70,7 @@ describe('workers/repository/apis', () => {
it('returns lerna package names', async () => {
const config = {
api: {
getFileJson: jest.fn(() => ({})),
getFileJson: jest.fn(() => ({ packages: ['packages/*'] })),
getSubDirectories: jest.fn(() => ['a', 'b']),
},
logger,