aaaaaaaaa

This commit is contained in:
xHyroM 2022-07-11 10:13:50 +02:00
parent 8c96e64ebf
commit 763bd6cb74
4 changed files with 14 additions and 8 deletions

View File

@ -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`),
};
}; };

View File

@ -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);
}; };

View File

@ -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`),
}
} }

View File

@ -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);
} }