Skip to content

Commit

Permalink
Swallow error on ENOENT
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky authored Apr 19, 2024
1 parent 327b709 commit b036c0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/install-pnpm/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ async function readTarget(opts: {
let packageManager

if (GITHUB_WORKSPACE) {
({ packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8')))
try {
({ packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8')))
} catch (error) {
// Swallow error if package.json doesn't exist in root
if (error.code !== 'ENOENT') throw error
}
}

if (version) {
Expand Down

0 comments on commit b036c0d

Please sign in to comment.