mirror of
https://github.com/pnpm/action-setup.git
synced 2025-03-31 05:00: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
|
let packageManager
|
||||||
|
|
||||||
if (GITHUB_WORKSPACE) {
|
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) {
|
if (version) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user