Skip to content

Commit 05faf97

Browse files
author
Emily Rodriguez
committed
check for directory
Signed-off-by: Emily Rodriguez <ecrodriguez@mm279976-pc.lan>
1 parent d95d36b commit 05faf97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

handler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ module.exports.saf = async (event, context, callback) => {
8080

8181
let OUTPUT_FOLDER = path.resolve('/tmp/', configData['output-prefix']);
8282
// Clear results folder from any old data
83-
fs.rmSync(OUTPUT_FOLDER, { recursive: true });
83+
if (fs.existsSync(OUTPUT_FOLDER)) {
84+
fs.rmSync(OUTPUT_FOLDER, { recursive: true });
85+
}
8486

8587
if (configData['output-enabled']) {
8688
command_string = `${command_string_input} -o ${OUTPUT_FOLDER}`;

0 commit comments

Comments
 (0)