diff --git a/lib/setup-terraform.js b/lib/setup-terraform.js index f6a7a1e..40ee0b1 100644 --- a/lib/setup-terraform.js +++ b/lib/setup-terraform.js @@ -137,16 +137,15 @@ async function run () { throw new Error(`Terraform version ${version} not available for ${platform} and ${arch}`); } - const nodeDirectory = tc.find('terraform', version, arch); - console.info(nodeDirectory); - if (!nodeDirectory) { + const pathToCLI = tc.find('terraform', version, arch); + if (!pathToCLI) { // Download requested version const pathToCLI = await downloadCLI(build.url); - - const cachedPath = await tc.cacheDir(pathToCLI, 'terraform', version); + + // add tool in cache + const cachedPath = await tc.cacheDir(pathToCLI, 'terraform', version, arch); core.addPath(cachedPath); } - // Install our wrapper if (wrapper) {