mirror of
https://github.com/actions/checkout.git
synced 2025-04-21 01:56:45 +00:00
update dev dependencies and react to new linting rules (#611)
This commit is contained in:
parent
c49af7ca1f
commit
eb8a193c1d
16 changed files with 14807 additions and 4534 deletions
|
@ -9,7 +9,7 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
|
|||
try {
|
||||
stats = fs.statSync(path)
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
if ((error as any)?.code === 'ENOENT') {
|
||||
if (!required) {
|
||||
return false
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ export function directoryExistsSync(path: string, required?: boolean): boolean {
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${error.message}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -39,12 +40,13 @@ export function existsSync(path: string): boolean {
|
|||
try {
|
||||
fs.statSync(path)
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
if ((error as any)?.code === 'ENOENT') {
|
||||
return false
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${error.message}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -60,12 +62,13 @@ export function fileExistsSync(path: string): boolean {
|
|||
try {
|
||||
stats = fs.statSync(path)
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
if ((error as any)?.code === 'ENOENT') {
|
||||
return false
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Encountered an error when checking whether path '${path}' exists: ${error.message}`
|
||||
`Encountered an error when checking whether path '${path}' exists: ${(error as any)
|
||||
?.message ?? error}`
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue