Skip to content

Commit a066569

Browse files
committed
fix: [#1] Adds try and catch for setting package.json version
1 parent a342722 commit a066569

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

bin/happy-set-workspace-version.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ async function getWorkspacePackages() {
6565

6666
for (const workspaceMatch of workspaceMatches) {
6767
for (const directory of workspaceMatch) {
68-
const packageJson = require(Path.join(rootDirectory, directory, 'package.json'));
68+
let packageJson;
6969

70-
if (!packageJson.private) {
70+
try{
71+
packageJson = require(Path.join(rootDirectory, directory, 'package.json'));
72+
} catch(e){
73+
// Ignore
74+
}
75+
76+
if (packageJson && !packageJson.private) {
7177
workspacePackages[packageJson.name] = {
7278
path: Path.join(rootDirectory, directory),
7379
packageJson

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)