diff --git a/dist/index.js b/dist/index.js index 2e0db83..956251f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29368,12 +29368,12 @@ function _installFromUrl(url_1, version_1) { } else { core.info(`${constants_1.ToolName} not found in cache`); - const downloadedFilePath = yield _downloadFile(url); core.setOutput(constants_1.Outputs.CacheHit, 'false'); // for tests if (failOnCacheMiss) { core.setFailed(`Cache miss for ${constants_1.ToolName} version ${version} arch ${os.arch()} and failOnCacheMiss is true.`); return; } + const downloadedFilePath = yield _downloadFile(url); if (core.isDebug()) { if (fs_1.default.existsSync(downloadedFilePath)) { core.info(`Downloaded ${url} in ${downloadedFilePath}`); @@ -29425,7 +29425,6 @@ function _installFromUrl(url_1, version_1) { core.info(`toolpath ${toolPath}`); core.addPath(cachedPath); } - core.addPath(toolPath); return; }); } @@ -29475,11 +29474,11 @@ function _installFromVersion(version_1) { core.info(`Windows detected, setting up bb.exe`); yield exec.exec('powershell', [ '-command', - `if (Test-Path('bb.exe')) { return } else { (New-Object Net.WebClient).DownloadFile('https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-windows-amd64.zip', 'bb.zip') }` + `(New-Object Net.WebClient).DownloadFile('https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-windows-amd64.zip', 'bb.zip')` ]); yield exec.exec('powershell', [ '-command', - "if (Test-Path('bb.exe')) { return } else { Expand-Archive bb.zip . }" + 'Expand-Archive -Force bb.zip .' ]); const bbExePath = path.join(process.cwd(), "bb.exe"); core.info(`exists? bb.exe ${fs_1.default.existsSync(bbExePath)}`); diff --git a/src/installer.ts b/src/installer.ts index d11eeb8..49706c2 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -72,15 +72,15 @@ export async function _installFromUrl( return; } else { core.info(`${ToolName} not found in cache`) - const downloadedFilePath = await _downloadFile(url) core.setOutput(Outputs.CacheHit, 'false') // for tests - if (failOnCacheMiss) { core.setFailed(`Cache miss for ${ToolName} version ${version} arch ${os.arch()} and failOnCacheMiss is true.`); return; } + const downloadedFilePath = await _downloadFile(url) + if (core.isDebug()) { if (fs.existsSync(downloadedFilePath)) { core.info(`Downloaded ${url} in ${downloadedFilePath}`) @@ -139,8 +139,6 @@ export async function _installFromUrl( core.addPath(cachedPath) } - core.addPath(toolPath) - return } @@ -197,11 +195,11 @@ export async function _installFromVersion(version: string, failOnCacheMiss: bool await exec.exec('powershell', [ '-command', - `if (Test-Path('bb.exe')) { return } else { (New-Object Net.WebClient).DownloadFile('https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-windows-amd64.zip', 'bb.zip') }` + `(New-Object Net.WebClient).DownloadFile('https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-windows-amd64.zip', 'bb.zip')` ]) await exec.exec('powershell', [ '-command', - "if (Test-Path('bb.exe')) { return } else { Expand-Archive bb.zip . }" + 'Expand-Archive -Force bb.zip .' ]) const bbExePath = path.join(process.cwd(), "bb.exe");