From e5e4b2086fca0e97906a95ad511fd8cb3fb0545a Mon Sep 17 00:00:00 2001 From: Jonathan Camara Date: Wed, 27 Apr 2022 16:20:22 -0500 Subject: [PATCH] fix: see if adding the extension fixes the problem --- dist/index.js | 13 +++---------- lib/setup-terraform.js | 13 +++---------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5058629..3116cdb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -39,18 +39,11 @@ async function downloadCLI (url) { const pathToCLIZip = await tc.downloadTool(url); core.info(`Terraform CLI Download Path is ${pathToCLIZip}`) - try { - const files = await fs.readdir(pathToCLIZip); - for (const file of files) - core.info(file); - - } catch (error) { - core.error(error); - throw error; - } + fixedPathToCLIZip=`${pathToCLIZip}.zip` + io.mv(pathToCLIZip,fixedPathToCLIZip) core.debug('Extracting Terraform CLI zip file'); - const pathToCLI = await tc.extractZip(pathToCLIZip); + const pathToCLI = await tc.extractZip(fixedPathToCLIZip); core.debug(`Terraform CLI path is ${pathToCLI}.`); if (!pathToCLIZip || !pathToCLI) { diff --git a/lib/setup-terraform.js b/lib/setup-terraform.js index aecf9ec..5e5288a 100644 --- a/lib/setup-terraform.js +++ b/lib/setup-terraform.js @@ -33,18 +33,11 @@ async function downloadCLI (url) { const pathToCLIZip = await tc.downloadTool(url); core.info(`Terraform CLI Download Path is ${pathToCLIZip}`) - try { - const files = await fs.readdir(pathToCLIZip); - for (const file of files) - core.info(file); - - } catch (error) { - core.error(error); - throw error; - } + fixedPathToCLIZip=`${pathToCLIZip}.zip` + io.mv(pathToCLIZip,fixedPathToCLIZip) core.debug('Extracting Terraform CLI zip file'); - const pathToCLI = await tc.extractZip(pathToCLIZip); + const pathToCLI = await tc.extractZip(fixedPathToCLIZip); core.debug(`Terraform CLI path is ${pathToCLI}.`); if (!pathToCLIZip || !pathToCLI) {