mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 04:58:25 +02:00
feat: custom download url, custom repository
This commit is contained in:
parent
27a94d6f80
commit
e6a8865f72
9 changed files with 135 additions and 21 deletions
6
dist/utils/getAsset.js
vendored
6
dist/utils/getAsset.js
vendored
|
@ -1,5 +1,5 @@
|
|||
import { exit } from '../index.js';
|
||||
export default (assets) => {
|
||||
export const getArchitecture = () => {
|
||||
let arch;
|
||||
switch (process.arch) {
|
||||
case 'arm64':
|
||||
|
@ -13,6 +13,10 @@ export default (assets) => {
|
|||
}
|
||||
if (!['linux', 'darwin'].some(platform => process.platform === platform))
|
||||
throw new Error(`Unsupported platform ${process.platform}.`);
|
||||
return arch;
|
||||
};
|
||||
export default (assets) => {
|
||||
const arch = getArchitecture();
|
||||
const assetName = `bun-${process.platform}-${arch}.zip`;
|
||||
const asset = assets.find(asset => asset.name === assetName);
|
||||
if (!asset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue