Skip to content

Commit

Permalink
Update get-monorepo-type.ts
Browse files Browse the repository at this point in the history
Fixes issues when no package.json exists at the root of a repo
  • Loading branch information
lifeiscontent committed May 19, 2022
1 parent 82696f1 commit 0d21b96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/telemetry/src/get-monorepo-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const getMonorepoType = (): MonorepoType => {
if (monorepoType) {
return monorepoType;
}

if (!fs.existsSync(path.join(projectRootPath, 'package.json'))) return undefined;

const packageJson = fs.readJsonSync(path.join(projectRootPath, 'package.json')) as PackageJson;

Expand Down

0 comments on commit 0d21b96

Please sign in to comment.