Skip to content

Commit

Permalink
add fallback filetype for older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Nov 21, 2023
1 parent 5418d8d commit 8e5d78f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function getDesiredFileExts(): [string, boolean, string] {

if (osPlat == 'win32') {
fileExt1 = 'tar.gz'
hasFileExt2 = false
fileExt2 = ''
hasFileExt2 = true
fileExt2 = '.exe'
} else if (osPlat == 'darwin') {
fileExt1 = 'tar.gz'
hasFileExt2 = true
Expand Down Expand Up @@ -233,10 +233,11 @@ export async function installJulia(versionInfo, version: string, arch: string):
await exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir])
return tempInstallDir
case 'win32':
if (version.endsWith('nightly') || semver.gtr(version, '1.3', {includePrerelease: true})) {
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
if (version.endsWith('nightly') || semver.gtr(version, '1.0', {includePrerelease: true})) {
await exec.exec('powershell', ['-Command', `tar xf ${juliaDownloadPath} --strip-components=1 -C ${tempInstallDir}`])
} else {
// before 1.0 only .exe's are available, and it's the older installer approach
// i.e. before the change in 1.4 to https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
}
return tempInstallDir
Expand Down

0 comments on commit 8e5d78f

Please sign in to comment.