mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-18 04:28:28 +02:00
refactor: move logic to getEffectiveArch func
This commit is contained in:
parent
c2c1757aa0
commit
bcfe2a9ff6
1 changed files with 11 additions and 4 deletions
|
@ -155,6 +155,15 @@ function isCacheEnabled(options: Input): boolean {
|
||||||
return isFeatureAvailable();
|
return isFeatureAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getEffectiveArch(os: string, arch: string): string {
|
||||||
|
// Temporary workaround for absence of arm64 builds on Windows (#130)
|
||||||
|
if (os === "win32" && arch === "arm64") {
|
||||||
|
return "x64";
|
||||||
|
}
|
||||||
|
|
||||||
|
return arch;
|
||||||
|
}
|
||||||
|
|
||||||
function getDownloadUrl(options: Input): string {
|
function getDownloadUrl(options: Input): string {
|
||||||
const { customUrl } = options;
|
const { customUrl } = options;
|
||||||
if (customUrl) {
|
if (customUrl) {
|
||||||
|
@ -164,10 +173,8 @@ function getDownloadUrl(options: Input): string {
|
||||||
const eversion = encodeURIComponent(version ?? "latest");
|
const eversion = encodeURIComponent(version ?? "latest");
|
||||||
const eos = encodeURIComponent(os ?? process.platform);
|
const eos = encodeURIComponent(os ?? process.platform);
|
||||||
const earch = encodeURIComponent(
|
const earch = encodeURIComponent(
|
||||||
(os ?? process.platform) === "win32" && (arch ?? process.arch) === "arm64"
|
getEffectiveArch(os ?? process.platform, arch ?? process.arch),
|
||||||
? "x64"
|
);
|
||||||
: (arch ?? process.arch),
|
|
||||||
); // Temporary workaround for absence of arm64 builds on Windows (#130)
|
|
||||||
const eavx2 = encodeURIComponent(avx2 ?? true);
|
const eavx2 = encodeURIComponent(avx2 ?? true);
|
||||||
const eprofile = encodeURIComponent(profile ?? false);
|
const eprofile = encodeURIComponent(profile ?? false);
|
||||||
const { href } = new URL(
|
const { href } = new URL(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue