diff options
| author | 2023-02-01 10:56:08 -0800 | |
|---|---|---|
| committer | 2023-02-01 10:56:08 -0800 | |
| commit | 9c27b5d17f3e2c54482be7df05577ca36dd824b3 (patch) | |
| tree | 7314889755c0760b3525bb4ef2ba030ca367d840 /packages/bun-release/src/platform.ts | |
| parent | 9973df028b9c272ea88804705282c4c31a4295e8 (diff) | |
| download | bun-9c27b5d17f3e2c54482be7df05577ca36dd824b3.tar.gz bun-9c27b5d17f3e2c54482be7df05577ca36dd824b3.tar.zst bun-9c27b5d17f3e2c54482be7df05577ca36dd824b3.zip | |
Fix getting SHA for canary
Diffstat (limited to 'packages/bun-release/src/platform.ts')
| -rw-r--r-- | packages/bun-release/src/platform.ts | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/packages/bun-release/src/platform.ts b/packages/bun-release/src/platform.ts index fb438d824..98fd6fe36 100644 --- a/packages/bun-release/src/platform.ts +++ b/packages/bun-release/src/platform.ts @@ -4,14 +4,9 @@ import { debug } from "./console"; export const os = process.platform; -export const arch = - os === "darwin" && process.arch === "x64" && isRosetta2() - ? "arm64" - : process.arch; +export const arch = os === "darwin" && process.arch === "x64" && isRosetta2() ? "arm64" : process.arch; -export const avx2 = - (arch === "x64" && os === "linux" && isLinuxAVX2()) || - (os === "darwin" && isDarwinAVX2()); +export const avx2 = (arch === "x64" && os === "linux" && isLinuxAVX2()) || (os === "darwin" && isDarwinAVX2()); export type Platform = { os: string; @@ -63,10 +58,7 @@ export const platforms: Platform[] = [ ]; export const supportedPlatforms: Platform[] = platforms - .filter( - (platform) => - platform.os === os && platform.arch === arch && (!platform.avx2 || avx2), - ) + .filter(platform => platform.os === os && platform.arch === arch && (!platform.avx2 || avx2)) .sort((a, b) => (a.avx2 === b.avx2 ? 0 : a.avx2 ? -1 : 1)); function isLinuxAVX2(): boolean { @@ -90,10 +82,7 @@ function isDarwinAVX2(): boolean { function isRosetta2(): boolean { try { - const { exitCode, stdout } = spawn("sysctl", [ - "-n", - "sysctl.proc_translated", - ]); + const { exitCode, stdout } = spawn("sysctl", ["-n", "sysctl.proc_translated"]); return exitCode === 0 && stdout.includes("1"); } catch (error) { debug("isRosetta2 failed", error); |
