mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
new: Clean target directory before saving. (#3)
This commit is contained in:
parent
8e43d3720d
commit
c33bc5a232
4 changed files with 69 additions and 28 deletions
12
src/fs.ts
Normal file
12
src/fs.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
|
||||
export async function rmrf(dir: string) {
|
||||
core.debug(`Deleting ${dir}`);
|
||||
|
||||
try {
|
||||
await io.rmRF(dir);
|
||||
} catch (error: unknown) {
|
||||
core.warning(`Failed to delete ${dir}: ${error}`);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue