Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -29425,7 +29425,6 @@ function _installFromUrl(url_1, version_1) {
core.info(`toolpath ${toolPath}`);
core.addPath(cachedPath);
}
core.addPath(toolPath);
return;
});
}
Expand Down Expand Up @@ -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)}`);
Expand Down
10 changes: 4 additions & 6 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down Expand Up @@ -139,8 +139,6 @@ export async function _installFromUrl(
core.addPath(cachedPath)
}

core.addPath(toolPath)

return
}

Expand Down Expand Up @@ -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");
Expand Down
Loading