mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 10:40:10 +08:00
chore: build
This commit is contained in:
parent
fe4b2b1cd6
commit
a99ac77932
5
dist/utils/install.js
vendored
5
dist/utils/install.js
vendored
@ -14,9 +14,8 @@ export default async (release, token) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
info(`Downloading Bun from ${asset.asset.browser_download_url}.`);
|
info(`Downloading Bun from ${asset.asset.browser_download_url}.`);
|
||||||
const zipPath = await downloadTool(asset.asset.browser_download_url, null, `token ${token}`, {
|
const zipPath = await downloadTool(asset.asset.browser_download_url, null, new URL(asset.asset.browser_download_url).host.includes('github.com') ? `token ${token}` : '', {
|
||||||
'Authorization': `token ${token}`,
|
'Authorization': new URL(asset.asset.browser_download_url).host.includes('github.com') ? `token ${token}` : ''
|
||||||
accept: 'application/octet-stream'
|
|
||||||
});
|
});
|
||||||
const extracted = await extractZip(zipPath, join(homedir(), '.bun', 'bin'));
|
const extracted = await extractZip(zipPath, join(homedir(), '.bun', 'bin'));
|
||||||
const newCache = await cacheDir(extracted, 'bun', release.version);
|
const newCache = await cacheDir(extracted, 'bun', release.version);
|
||||||
|
@ -5,7 +5,6 @@ import { addPath, info } from '@actions/core';
|
|||||||
import getAsset from './getAsset.js';
|
import getAsset from './getAsset.js';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
import fetch from 'node-fetch';
|
|
||||||
|
|
||||||
export default async(release: Release, token: string) => {
|
export default async(release: Release, token: string) => {
|
||||||
const asset = getAsset(release.assets);
|
const asset = getAsset(release.assets);
|
||||||
@ -22,10 +21,9 @@ export default async(release: Release, token: string) => {
|
|||||||
const zipPath = await downloadTool(
|
const zipPath = await downloadTool(
|
||||||
asset.asset.browser_download_url,
|
asset.asset.browser_download_url,
|
||||||
null,
|
null,
|
||||||
`token ${token}`,
|
new URL(asset.asset.browser_download_url).host.includes('github.com') ? `token ${token}` : '',
|
||||||
{
|
{
|
||||||
'Authorization': `token ${token}`,
|
'Authorization': new URL(asset.asset.browser_download_url).host.includes('github.com') ? `token ${token}` : ''
|
||||||
accept: 'application/octet-stream'
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const extracted = await extractZip(zipPath, join(homedir(), '.bun', 'bin'));
|
const extracted = await extractZip(zipPath, join(homedir(), '.bun', 'bin'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user