mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-21 13:49:06 +08:00
Test out checking for fileexists in rmFile
This commit is contained in:
parent
c91bdbadbf
commit
cc9ec0424e
@ -270,6 +270,16 @@ export async function getFileSize(filePath: string): Promise<number> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function rmFile(filePath: string): Promise<void> {
|
export async function rmFile(filePath: string): Promise<void> {
|
||||||
|
// TODO: find actual fix
|
||||||
|
// node 16 `CreateWriteStream` no longer creates a file
|
||||||
|
// download-http-client.ts#L151 no longer creates a file and we fail here
|
||||||
|
try {
|
||||||
|
await fs.stat(filePath)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log("File does not exist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
await fs.unlink(filePath)
|
await fs.unlink(filePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user