mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-27 21:43:38 +00:00
fix: only change file extension of we are on Windows
This commit is contained in:
parent
62f144899a
commit
07c30f59da
2 changed files with 22 additions and 10 deletions
|
|
@ -32,13 +32,19 @@ async function downloadCLI (url) {
|
|||
core.debug(`Downloading Terraform CLI from ${url}`);
|
||||
const pathToCLIZip = await tc.downloadTool(url);
|
||||
|
||||
core.debug(`Terraform CLI Download Path is ${pathToCLIZip}`)
|
||||
fixedPathToCLIZip=`${pathToCLIZip}.zip`
|
||||
io.mv(pathToCLIZip,fixedPathToCLIZip)
|
||||
core.debug(`Moved download to ${fixedPathToCLIZip}`)
|
||||
const pathToCLI = "";
|
||||
|
||||
if (os.platform().startsWith('win')) {
|
||||
core.debug(`Terraform CLI Download Path is ${pathToCLIZip}`)
|
||||
fixedPathToCLIZip = `${pathToCLIZip}.zip`
|
||||
io.mv(pathToCLIZip, fixedPathToCLIZip)
|
||||
core.debug(`Moved download to ${fixedPathToCLIZip}`)
|
||||
pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
||||
} else {
|
||||
pathToCLI = await tc.extractZip(pathToCLIZip);
|
||||
}
|
||||
|
||||
core.debug('Extracting Terraform CLI zip file');
|
||||
const pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
||||
core.debug(`Terraform CLI path is ${pathToCLI}.`);
|
||||
|
||||
if (!pathToCLIZip || !pathToCLI) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue