Skip to content

Commit a515f9f

Browse files
authored
Add more error checking in getNightlyFileName (#237)
1 parent 5fb759d commit a515f9f

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

lib/installer.js

Lines changed: 21 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,34 @@ function getNightlyFileName(arch: string): string {
124124
[fileExt1, , ] = getDesiredFileExts()
125125

126126
if (osPlat == 'win32') {
127-
versionExt = arch == 'x64' ? '-win64' : '-win32'
127+
if (arch == 'x86') {
128+
versionExt = '-win32'
129+
} else if (arch == 'aarch64') {
130+
throw new Error('Aarch64 Julia is not available on Windows')
131+
} else if (arch == 'x64') {
132+
versionExt = '-win64'
133+
} else {
134+
throw new Error(`Architecture ${arch} is not supported on Windows`)
135+
}
128136
} else if (osPlat == 'darwin') {
129137
if (arch == 'x86') {
130-
throw new Error('32-bit Julia is not available on macOS')
138+
throw new Error('32-bit (x86) Julia is not available on macOS')
131139
} else if (arch == 'aarch64') {
132140
versionExt = '-macaarch64'
133-
} else {
141+
} else if (arch == 'x64') {
134142
versionExt = '-mac64'
143+
} else {
144+
throw new Error(`Architecture ${arch} is not supported on macOS`)
135145
}
136146
} else if (osPlat === 'linux') {
137147
if (arch == 'x86') {
138148
versionExt = '-linux32'
139149
} else if (arch == 'aarch64') {
140150
versionExt = '-linux-aarch64'
141-
} else {
151+
} else if (arch == 'x64') {
142152
versionExt = '-linux64'
153+
} else {
154+
throw new Error(`Architecture ${arch} is not supported on Linux`)
143155
}
144156
} else {
145157
throw new Error(`Platform ${osPlat} is not supported`)

0 commit comments

Comments
 (0)