mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 18:50:10 +08:00
aaaaaaaaa
This commit is contained in:
parent
8c96e64ebf
commit
763bd6cb74
5
dist/utils/getAsset.js
vendored
5
dist/utils/getAsset.js
vendored
@ -21,5 +21,8 @@ export default (assets) => {
|
|||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported platform ${process.platform}.`);
|
throw new Error(`Unsupported platform ${process.platform}.`);
|
||||||
}
|
}
|
||||||
return assets.find(asset => asset.name === `bun-${platform}-${arch}.zip`);
|
return {
|
||||||
|
name: `bun-${platform}-${arch}.zip`,
|
||||||
|
asset: assets.find(asset => asset.name === `bun-${platform}-${arch}.zip`),
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
6
dist/utils/install.js
vendored
6
dist/utils/install.js
vendored
@ -12,14 +12,14 @@ export default async (release) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
info(`Downloading Bun from ${asset.asset.browser_download_url}.`);
|
||||||
const zipPath = await downloadTool(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.tag_name);
|
const newCache = await cacheDir(extracted, 'bun', release.tag_name);
|
||||||
info(`Cached Bun to ${newCache}.`);
|
info(`Cached Bun to ${newCache}.`);
|
||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
console.log(extracted);
|
console.log(extracted);
|
||||||
const bunPath = join(getHomeDir(), ".bun", "bin");
|
const bunPath = join(getHomeDir(), ".bun", "bin", asset.name.replaceAll('.zip', ''));
|
||||||
console.log(readdirSync(bunPath));
|
console.log(readdirSync(bunPath));
|
||||||
addPath(bunPath);
|
addPath(bunPath);
|
||||||
};
|
};
|
||||||
|
@ -25,5 +25,8 @@ export default (assets: Asset[]) => {
|
|||||||
throw new Error(`Unsupported platform ${process.platform}.`);
|
throw new Error(`Unsupported platform ${process.platform}.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return assets.find(asset => asset.name === `bun-${platform}-${arch}.zip`);
|
return {
|
||||||
|
name: `bun-${platform}-${arch}.zip`,
|
||||||
|
asset: assets.find(asset => asset.name === `bun-${platform}-${arch}.zip`),
|
||||||
|
}
|
||||||
}
|
}
|
@ -16,9 +16,9 @@ export default async(release: Release) => {
|
|||||||
|
|
||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
|
|
||||||
info(`Downloading Bun from ${asset.browser_download_url}.`);
|
info(`Downloading Bun from ${asset.asset.browser_download_url}.`);
|
||||||
|
|
||||||
const zipPath = await downloadTool(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(
|
const newCache = await cacheDir(
|
||||||
@ -31,7 +31,7 @@ export default async(release: Release) => {
|
|||||||
addPath(newCache);
|
addPath(newCache);
|
||||||
|
|
||||||
console.log(extracted);
|
console.log(extracted);
|
||||||
const bunPath = join(getHomeDir(), ".bun", "bin");
|
const bunPath = join(getHomeDir(), ".bun", "bin", asset.name.replaceAll('.zip', ''));
|
||||||
console.log(readdirSync(bunPath));
|
console.log(readdirSync(bunPath));
|
||||||
addPath(bunPath);
|
addPath(bunPath);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user