mirror of
https://github.com/pnpm/action-setup.git
synced 2025-03-28 02:30:11 +08:00
Swallow error on ENOENT
This commit is contained in:
parent
327b709af8
commit
b036c0dcb9
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user