Skip to content

Commit

Permalink
fix: fix zip extract from cache
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jul 11, 2022
1 parent 41c7fe5 commit 9d93b1d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/js/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ async function pickVersion(repo, range) {

async function getBunSource(repo, version, platform) {
const _version = version.replace('bun-', '')
const file = `bun-${version}-${platform}.zip`
const cachedBunPath = tc.find('bun', _version, platform)
if (cachedBunPath) {
core.info(`bun ${_version} ${platform} found in cache'`)
return cachedBunPath
core.info(`bun ${_version} ${platform} found in cache`)
return path.join(cachedBunPath, file)
}

const bunUri = getBunUri(repo, version, platform)
core.info(`Downloading bun from ${bunUri}`)
const bunPath = await tc.downloadTool(bunUri)

await tc.cacheFile(bunPath, `bun-${version}-${platform}`, 'bun', _version, platform)
await tc.cacheFile(bunPath, file, 'bun', _version, platform)
core.info(`bun bin cached as ${tc.find('bun', _version, platform)}`)

return bunPath
Expand Down

0 comments on commit 9d93b1d

Please sign in to comment.