chore: build
This commit is contained in:
6
dist/utils/install.js
vendored
6
dist/utils/install.js
vendored
@@ -8,7 +8,8 @@ import { readdirSync } from 'fs';
|
|||||||
export default async (release) => {
|
export default async (release) => {
|
||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
const path = join(getHomeDir(), '.bun', 'bin', asset.name);
|
const path = join(getHomeDir(), '.bun', 'bin', asset.name);
|
||||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}`);
|
console.log(path);
|
||||||
|
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
info(`Using cached Bun installation from ${cache}.`);
|
info(`Using cached Bun installation from ${cache}.`);
|
||||||
console.log(path);
|
console.log(path);
|
||||||
@@ -20,7 +21,8 @@ export default async (release) => {
|
|||||||
const zipPath = await downloadTool(asset.asset.browser_download_url);
|
const zipPath = await downloadTool(asset.asset.browser_download_url);
|
||||||
const extracted = await extractZip(zipPath, join(getHomeDir(), '.bun', 'bin'));
|
const extracted = await extractZip(zipPath, join(getHomeDir(), '.bun', 'bin'));
|
||||||
const newCache = await cacheDir(extracted, 'bun', release.version);
|
const newCache = await cacheDir(extracted, 'bun', release.version);
|
||||||
await saveCache([extracted], `bun-${process.platform}-${asset.name}`);
|
console.log(extracted);
|
||||||
|
await saveCache([extracted], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
info(`Cached Bun to ${newCache}.`);
|
info(`Cached Bun to ${newCache}.`);
|
||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name);
|
const bunPath = join(getHomeDir(), '.bun', 'bin', asset.name);
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import { readdirSync } from 'fs';
|
|||||||
export default async(release: Release) => {
|
export default async(release: Release) => {
|
||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
const path = join(getHomeDir(), '.bun', 'bin', asset.name);
|
const path = join(getHomeDir(), '.bun', 'bin', asset.name);
|
||||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}`);
|
console.log(path);
|
||||||
|
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
info(`Using cached Bun installation from ${cache}.`);
|
info(`Using cached Bun installation from ${cache}.`);
|
||||||
console.log(path);
|
console.log(path);
|
||||||
@@ -29,7 +30,8 @@ export default async(release: Release) => {
|
|||||||
'bun',
|
'bun',
|
||||||
release.version
|
release.version
|
||||||
);
|
);
|
||||||
await saveCache([extracted], `bun-${process.platform}-${asset.name}`);
|
console.log(extracted);
|
||||||
|
await saveCache([extracted], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
|
|
||||||
info(`Cached Bun to ${newCache}.`);
|
info(`Cached Bun to ${newCache}.`);
|
||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
|
|||||||
Reference in New Issue
Block a user