set path correctly

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
Eli Uriegas 2021-05-18 13:47:34 -07:00
parent b6f5f11fd5
commit 5a1313076c
2 changed files with 6 additions and 6 deletions

6
dist/index.js vendored
View file

@ -31175,7 +31175,7 @@ function run() {
continue;
}
const localKey = fileObject.Key.replace(s3Prefix, '');
core.info(`Downloading ${localKey}`);
core.info(`Started download: ${localKey}`);
core.debug(`S3 download uri: s3://${s3Bucket}/${fileObject.Key}`);
s3.getObject({ Bucket: s3Bucket, Key: fileObject.Key }, function (err, fileContents) {
var _a;
@ -31183,8 +31183,8 @@ function run() {
core.error(`Error downloading ${localKey}`);
throw err;
}
fs.writeFileSync(path_1.default.resolve(resolvedPath, localKey), (_a = fileContents.Body) === null || _a === void 0 ? void 0 : _a.toString());
core.info(`DONE: ${localKey}`);
fs.writeFileSync(path_1.default.join(resolvedPath, localKey), (_a = fileContents.Body) === null || _a === void 0 ? void 0 : _a.toString());
core.info(`Done: ${localKey}`);
});
}
});

View file

@ -33,7 +33,7 @@ async function run(): Promise<void> {
continue
}
const localKey = fileObject.Key.replace(s3Prefix, '')
core.info(`Downloading ${localKey}`)
core.info(`Started download: ${localKey}`)
core.debug(`S3 download uri: s3://${s3Bucket}/${fileObject.Key}`)
s3.getObject({Bucket: s3Bucket, Key: fileObject.Key}, function (
err,
@ -44,10 +44,10 @@ async function run(): Promise<void> {
throw err
}
fs.writeFileSync(
path.resolve(resolvedPath, localKey),
path.join(resolvedPath, localKey),
fileContents.Body?.toString()
)
core.info(`DONE: ${localKey}`)
core.info(`Done: ${localKey}`)
})
}
})