2 parents 7be8083 + 80d5f4e commit 032138dCopy full SHA for 032138d
1 file changed
src/util.ts
@@ -84,9 +84,11 @@ export async function withTmpDir<T>(
84
body: (tmpDir: string) => Promise<T>,
85
): Promise<T> {
86
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
87
- const result = await body(tmpDir);
88
- await fs.promises.rm(tmpDir, { force: true, recursive: true });
89
- return result;
+ try {
+ return await body(tmpDir);
+ } finally {
90
+ await fs.promises.rm(tmpDir, { force: true, recursive: true });
91
+ }
92
}
93
94
/**
0 commit comments