diff --git a/dist/utils/getAsset.js b/dist/utils/getAsset.js index b7fa538..73872e1 100644 --- a/dist/utils/getAsset.js +++ b/dist/utils/getAsset.js @@ -13,7 +13,7 @@ export default (assets) => { if (!['linux', 'darwin'].some(platform => process.platform === platform)) throw new Error(`Unsupported platform ${process.platform}.`); return { - name: `bun-${process.platform}-${arch}.zip`, + name: `bun-${process.platform}-${arch}`, asset: assets.find(asset => asset.name === `bun-${process.platform}-${arch}.zip`), }; }; diff --git a/dist/utils/install.js b/dist/utils/install.js index 11c702e..ba8ace6 100644 --- a/dist/utils/install.js +++ b/dist/utils/install.js @@ -7,7 +7,7 @@ import { join } from 'path'; import { readdirSync } from 'fs'; export default async (release) => { const asset = getAsset(release.assets); - const path = join(getHomeDir(), '.bun', 'bin'); + const path = join(getHomeDir(), '.bun', 'bin', asset.name); const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}`); if (cache) { info(`Using cached Bun installation from ${cache}.`); @@ -23,6 +23,6 @@ export default async (release) => { await saveCache([extracted], `bun-${process.platform}-${asset.name}`); info(`Cached Bun to ${newCache}.`); addPath(newCache); - const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name.replace('.zip', '')); + const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name); addPath(bunPath); }; diff --git a/src/utils/getAsset.ts b/src/utils/getAsset.ts index ed909bd..5a2415a 100644 --- a/src/utils/getAsset.ts +++ b/src/utils/getAsset.ts @@ -17,7 +17,7 @@ export default (assets: Asset[]) => { throw new Error(`Unsupported platform ${process.platform}.`); return { - name: `bun-${process.platform}-${arch}.zip`, + name: `bun-${process.platform}-${arch}`, asset: assets.find(asset => asset.name === `bun-${process.platform}-${arch}.zip`), } } \ No newline at end of file diff --git a/src/utils/install.ts b/src/utils/install.ts index 59cd0db..4da5d69 100644 --- a/src/utils/install.ts +++ b/src/utils/install.ts @@ -9,7 +9,7 @@ import { readdirSync } from 'fs'; export default async(release: Release) => { const asset = getAsset(release.assets); - const path = join(getHomeDir(), '.bun', 'bin'); + const path = join(getHomeDir(), '.bun', 'bin', asset.name); const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}`); if (cache) { info(`Using cached Bun installation from ${cache}.`); @@ -34,6 +34,6 @@ export default async(release: Release) => { info(`Cached Bun to ${newCache}.`); addPath(newCache); - const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name.replace('.zip', '')); + const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name); addPath(bunPath); } \ No newline at end of file