new: Clean target directory before saving. (#3)

This commit is contained in:
Miles Johnson 2023-04-17 18:58:11 -07:00 committed by GitHub
parent 8e43d3720d
commit c33bc5a232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 28 deletions

12
src/fs.ts Normal file
View 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}`);
}
}