From ed1916672dc9134e021edd818888303c783663e7 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Tue, 18 May 2021 11:15:30 -0700 Subject: [PATCH] fix formatting Signed-off-by: Eli Uriegas --- dist/index.js | 2 +- src/download-artifact.ts | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 53840db..52b01b6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31173,7 +31173,7 @@ function run() { const name = core.getInput(constants_1.Inputs.Name, { required: false }); const chosenPath = core.getInput(constants_1.Inputs.Path, { required: false }); const s3Bucket = core.getInput(constants_1.Inputs.S3Bucket, { required: false }); - let resolvedPath = ""; + let resolvedPath = ''; // resolve tilde expansions, path.replace only replaces the first occurrence of a pattern if (chosenPath.startsWith(`~`)) { path_1.default.resolve(); diff --git a/src/download-artifact.ts b/src/download-artifact.ts index 577055c..e765801 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -13,7 +13,7 @@ async function run(): Promise { const chosenPath = core.getInput(Inputs.Path, {required: false}) const s3Bucket = core.getInput(Inputs.S3Bucket, {required: false}) - let resolvedPath = ""; + let resolvedPath = '' // resolve tilde expansions, path.replace only replaces the first occurrence of a pattern if (chosenPath.startsWith(`~`)) { path.resolve() @@ -34,19 +34,19 @@ async function run(): Promise { continue } core.info(`Grabbing ${fileObject.Key}`) - s3.getObject({Bucket: s3Bucket, Key: fileObject.Key}, function ( - err, - fileContents - ) { - if (err) { - core.error(err) - throw err + s3.getObject( + {Bucket: s3Bucket, Key: fileObject.Key}, + function (err, fileContents) { + if (err) { + core.error(err) + throw err + } + fs.writeFileSync( + path.resolve(resolvedPath, fileObject.Key as string), + fileContents.Body?.toString() + ) } - fs.writeFileSync( - path.resolve(resolvedPath, fileObject.Key as string), - fileContents.Body?.toString() - ) - }) + ) } }) // output the directory that the artifact(s) was/were downloaded to