mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 11:06:53 +08:00
Add more error checking in getNightlyFileName (#237)
This commit is contained in:
25
lib/installer.js
generated
25
lib/installer.js
generated
@@ -150,18 +150,32 @@ function getNightlyFileName(arch) {
|
|||||||
let fileExt1;
|
let fileExt1;
|
||||||
[fileExt1, ,] = getDesiredFileExts();
|
[fileExt1, ,] = getDesiredFileExts();
|
||||||
if (osPlat == 'win32') {
|
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') {
|
else if (osPlat == 'darwin') {
|
||||||
if (arch == 'x86') {
|
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') {
|
else if (arch == 'aarch64') {
|
||||||
versionExt = '-macaarch64';
|
versionExt = '-macaarch64';
|
||||||
}
|
}
|
||||||
else {
|
else if (arch == 'x64') {
|
||||||
versionExt = '-mac64';
|
versionExt = '-mac64';
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw new Error(`Architecture ${arch} is not supported on macOS`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (osPlat === 'linux') {
|
else if (osPlat === 'linux') {
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
@@ -170,9 +184,12 @@ function getNightlyFileName(arch) {
|
|||||||
else if (arch == 'aarch64') {
|
else if (arch == 'aarch64') {
|
||||||
versionExt = '-linux-aarch64';
|
versionExt = '-linux-aarch64';
|
||||||
}
|
}
|
||||||
else {
|
else if (arch == 'x64') {
|
||||||
versionExt = '-linux64';
|
versionExt = '-linux64';
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw new Error(`Architecture ${arch} is not supported on Linux`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw new Error(`Platform ${osPlat} is not supported`);
|
||||||
|
|||||||
@@ -124,22 +124,34 @@ function getNightlyFileName(arch: string): string {
|
|||||||
[fileExt1, , ] = getDesiredFileExts()
|
[fileExt1, , ] = getDesiredFileExts()
|
||||||
|
|
||||||
if (osPlat == 'win32') {
|
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') {
|
} else if (osPlat == 'darwin') {
|
||||||
if (arch == 'x86') {
|
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') {
|
} else if (arch == 'aarch64') {
|
||||||
versionExt = '-macaarch64'
|
versionExt = '-macaarch64'
|
||||||
} else {
|
} else if (arch == 'x64') {
|
||||||
versionExt = '-mac64'
|
versionExt = '-mac64'
|
||||||
|
} else {
|
||||||
|
throw new Error(`Architecture ${arch} is not supported on macOS`)
|
||||||
}
|
}
|
||||||
} else if (osPlat === 'linux') {
|
} else if (osPlat === 'linux') {
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
versionExt = '-linux32'
|
versionExt = '-linux32'
|
||||||
} else if (arch == 'aarch64') {
|
} else if (arch == 'aarch64') {
|
||||||
versionExt = '-linux-aarch64'
|
versionExt = '-linux-aarch64'
|
||||||
} else {
|
} else if (arch == 'x64') {
|
||||||
versionExt = '-linux64'
|
versionExt = '-linux64'
|
||||||
|
} else {
|
||||||
|
throw new Error(`Architecture ${arch} is not supported on Linux`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`)
|
throw new Error(`Platform ${osPlat} is not supported`)
|
||||||
|
|||||||
Reference in New Issue
Block a user