Add more error checking in getNightlyFileName (#237)

This commit is contained in:
Dilum Aluthge
2024-04-28 20:02:37 -04:00
committed by GitHub
parent 5fb759db5c
commit a515f9fb49
2 changed files with 37 additions and 8 deletions

View File

@@ -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`)