mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 12:38:24 +02:00
chore: base
This commit is contained in:
parent
b04d87b14c
commit
e187173d21
425 changed files with 1080881 additions and 5 deletions
29
src/utils/getAsset.ts
Normal file
29
src/utils/getAsset.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { Asset } from './getGithubRelease.js';
|
||||
|
||||
export default (assets: Asset[]) => {
|
||||
let arch;
|
||||
switch (process.arch) {
|
||||
case 'arm64':
|
||||
arch = 'aarch64';
|
||||
break;
|
||||
case 'x64':
|
||||
arch = 'x64';
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported architechture ${process.arch}.`);
|
||||
}
|
||||
|
||||
let platform;
|
||||
switch (process.platform) {
|
||||
case 'linux':
|
||||
platform = 'linux'
|
||||
break;
|
||||
case 'darwin':
|
||||
platform = 'darwin'
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported platform ${process.platform}.`);
|
||||
}
|
||||
|
||||
return assets.find(asset => asset.name === `bun-${platform}-${arch}.zip`);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue