Skip to content

Commit

Permalink
feat: don't error if no packages are found (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
azz committed Dec 17, 2017
1 parent e50c927 commit dc6466d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/get-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default directory => {
}
}

throw new Error(`unable to find monorepo packages`);
// Bail if we don't find any packages
return [];
};

const findPackages = (packageSpecs, rootDirectory) => {
Expand Down
4 changes: 4 additions & 0 deletions test/get-packages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ describe('getPackages()', () => {
test('yarn matches snapshot', () => {
expect(getPackages(YARN_DIR)).toMatchSnapshot();
});

test('returns empty array when no packages', () => {
expect(getPackages(__dirname)).toEqual([]);
});
});

0 comments on commit dc6466d

Please sign in to comment.