mirror of https://github.com/actions/toolkit
only unlink if still exists
parent
35cba88c68
commit
8d2f32e652
|
@ -167,7 +167,9 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||||
console.log('b')
|
console.log('b')
|
||||||
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
|
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
|
||||||
try {
|
try {
|
||||||
await ioUtil.unlink(inputPath)
|
if (ioUtil.exists(inputPath)) {
|
||||||
|
await ioUtil.unlink(inputPath)
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
// other errors are valid
|
// other errors are valid
|
||||||
|
|
Loading…
Reference in New Issue