mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-03 23:42:54 +08:00
fix: use stat instead of lstat (#1190)
This commit is contained in:
parent
2c09aaef3b
commit
411e8fa448
@ -25,7 +25,7 @@ export function getUploadSpecification(
|
|||||||
if (!fs.existsSync(rootDirectory)) {
|
if (!fs.existsSync(rootDirectory)) {
|
||||||
throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`)
|
throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`)
|
||||||
}
|
}
|
||||||
if (!fs.lstatSync(rootDirectory).isDirectory()) {
|
if (!fs.statSync(rootDirectory).isDirectory()) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Provided rootDirectory ${rootDirectory} is not a valid directory`
|
`Provided rootDirectory ${rootDirectory} is not a valid directory`
|
||||||
)
|
)
|
||||||
@ -57,7 +57,7 @@ export function getUploadSpecification(
|
|||||||
if (!fs.existsSync(file)) {
|
if (!fs.existsSync(file)) {
|
||||||
throw new Error(`File ${file} does not exist`)
|
throw new Error(`File ${file} does not exist`)
|
||||||
}
|
}
|
||||||
if (!fs.lstatSync(file).isDirectory()) {
|
if (!fs.statSync(file).isDirectory()) {
|
||||||
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
// Normalize and resolve, this allows for either absolute or relative paths to be used
|
||||||
file = normalize(file)
|
file = normalize(file)
|
||||||
file = resolve(file)
|
file = resolve(file)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user