Skip to content

Commit e9833b2

Browse files
author
Emily Rodriguez
committed
fix path for windows
Signed-off-by: Emily Rodriguez <ecrodriguez@mm279976-pc.lan>
1 parent 5770545 commit e9833b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

handler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function uploadAllFiles(folder, configData, logger) {
6262
for await (const dirent of dir) {
6363
logger.info("Looking at the following entry: " + dirent.name);
6464
let localFileName = path.join(folder, dirent.name);
65-
let outputKey = path.relative('/tmp/', localFileName);
65+
let outputKey = path.relative('/tmp/', localFileName).replace(/^\\\\\?\\/,"").replace(/\\/g,'\/').replace(/\/\/+/g,'\/');
6666
logger.info("Local File Name: " + localFileName + ", Output key: " + outputKey + " for bucket: " + configData['output-bucket']);
6767
uploadFile(localFileName, configData['output-bucket'], outputKey);
6868
}
@@ -77,6 +77,7 @@ module.exports.saf = async (event, context, callback) => {
7777
let command_string = `${command_string_input}`;
7878

7979
let OUTPUT_FOLDER = path.resolve('/tmp/', configData['output-prefix']);
80+
// Clear results folder from any old data
8081
fs.rmSync(OUTPUT_FOLDER, { recursive: true });
8182

8283
if (configData['output-enabled']) {

0 commit comments

Comments
 (0)