diff --git a/lib/installer.js b/lib/installer.js index fcd82f53..4232965a 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -150,18 +150,32 @@ function getNightlyFileName(arch) { let fileExt1; [fileExt1, ,] = getDesiredFileExts(); if (osPlat == 'win32') { - versionExt = arch == 'x64' ? '-win64' : '-win32'; + if (arch == 'x86') { + versionExt = '-win32'; + } + else if (arch == 'aarch64') { + throw new Error('Aarch64 Julia is not available on Windows'); + } + else if (arch == 'x64') { + versionExt = '-win64'; + } + else { + throw new Error(`Architecture ${arch} is not supported on Windows`); + } } else if (osPlat == 'darwin') { if (arch == 'x86') { - throw new Error('32-bit Julia is not available on macOS'); + throw new Error('32-bit (x86) Julia is not available on macOS'); } else if (arch == 'aarch64') { versionExt = '-macaarch64'; } - else { + else if (arch == 'x64') { versionExt = '-mac64'; } + else { + throw new Error(`Architecture ${arch} is not supported on macOS`); + } } else if (osPlat === 'linux') { if (arch == 'x86') { @@ -170,9 +184,12 @@ function getNightlyFileName(arch) { else if (arch == 'aarch64') { versionExt = '-linux-aarch64'; } - else { + else if (arch == 'x64') { versionExt = '-linux64'; } + else { + throw new Error(`Architecture ${arch} is not supported on Linux`); + } } else { throw new Error(`Platform ${osPlat} is not supported`); diff --git a/src/installer.ts b/src/installer.ts index f6c040a2..1d2b68ef 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -124,22 +124,34 @@ function getNightlyFileName(arch: string): string { [fileExt1, , ] = getDesiredFileExts() if (osPlat == 'win32') { - versionExt = arch == 'x64' ? '-win64' : '-win32' + if (arch == 'x86') { + versionExt = '-win32' + } else if (arch == 'aarch64') { + throw new Error('Aarch64 Julia is not available on Windows') + } else if (arch == 'x64') { + versionExt = '-win64' + } else { + throw new Error(`Architecture ${arch} is not supported on Windows`) + } } else if (osPlat == 'darwin') { if (arch == 'x86') { - throw new Error('32-bit Julia is not available on macOS') + throw new Error('32-bit (x86) Julia is not available on macOS') } else if (arch == 'aarch64') { versionExt = '-macaarch64' - } else { + } else if (arch == 'x64') { versionExt = '-mac64' + } else { + throw new Error(`Architecture ${arch} is not supported on macOS`) } } else if (osPlat === 'linux') { if (arch == 'x86') { versionExt = '-linux32' } else if (arch == 'aarch64') { versionExt = '-linux-aarch64' - } else { + } else if (arch == 'x64') { versionExt = '-linux64' + } else { + throw new Error(`Architecture ${arch} is not supported on Linux`) } } else { throw new Error(`Platform ${osPlat} is not supported`)