chore: base
This commit is contained in:
25
dist/utils/getAsset.js
vendored
Normal file
25
dist/utils/getAsset.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export default (assets) => {
|
||||
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`);
|
||||
};
|
||||
Reference in New Issue
Block a user