@@ -198,7 +198,7 @@ export function getDownloadURL(fileInfo, version: string, arch: string): string
198
198
return fileInfo . url
199
199
}
200
200
201
- export async function installJulia ( versionInfo , version : string , arch : string ) : Promise < string > {
201
+ export async function installJulia ( dest : string , versionInfo , version : string , arch : string ) : Promise < string > {
202
202
// Download Julia
203
203
const fileInfo = getFileInfo ( versionInfo , version , arch )
204
204
const downloadURL = getDownloadURL ( fileInfo , version , arch )
@@ -226,37 +226,35 @@ export async function installJulia(versionInfo, version: string, arch: string):
226
226
core . debug ( 'Skipping checksum check for nightly binaries.' )
227
227
}
228
228
229
- const tempInstallDir = fs . mkdtempSync ( `julia-${ arch } -${ version } -` )
230
-
231
229
// Install it
232
230
switch ( osPlat ) {
233
231
case 'linux' :
234
232
// tc.extractTar doesn't support stripping components, so we have to call tar manually
235
- await exec . exec ( 'tar' , [ 'xf' , juliaDownloadPath , '--strip-components=1' , '-C' , tempInstallDir ] )
236
- return tempInstallDir
233
+ await exec . exec ( 'tar' , [ 'xf' , juliaDownloadPath , '--strip-components=1' , '-C' , dest ] )
234
+ return dest
237
235
case 'win32' :
238
236
if ( fileInfo !== null && fileInfo . extension == 'exe' ) {
239
237
if ( version . endsWith ( 'nightly' ) || semver . gtr ( version , '1.3' , { includePrerelease : true } ) ) {
240
238
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
241
- await exec . exec ( 'powershell' , [ '-Command' , `Start-Process -FilePath ${ juliaDownloadPath } -ArgumentList "/SILENT /dir=${ path . join ( process . cwd ( ) , tempInstallDir ) } " -NoNewWindow -Wait` ] )
239
+ await exec . exec ( 'powershell' , [ '-Command' , `Start-Process -FilePath ${ juliaDownloadPath } -ArgumentList "/SILENT /dir=${ path . join ( process . cwd ( ) , dest ) } " -NoNewWindow -Wait` ] )
242
240
} else {
243
- await exec . exec ( 'powershell' , [ '-Command' , `Start-Process -FilePath ${ juliaDownloadPath } -ArgumentList "/S /D=${ path . join ( process . cwd ( ) , tempInstallDir ) } " -NoNewWindow -Wait` ] )
241
+ await exec . exec ( 'powershell' , [ '-Command' , `Start-Process -FilePath ${ juliaDownloadPath } -ArgumentList "/S /D=${ path . join ( process . cwd ( ) , dest ) } " -NoNewWindow -Wait` ] )
244
242
}
245
243
} else {
246
244
// This is the more common path. Using .tar.gz is much faster
247
- await exec . exec ( 'powershell' , [ '-Command' , `tar xf ${ juliaDownloadPath } --strip-components=1 -C ${ tempInstallDir } ` ] )
245
+ await exec . exec ( 'powershell' , [ '-Command' , `tar xf ${ juliaDownloadPath } --strip-components=1 -C ${ dest } ` ] )
248
246
}
249
- return tempInstallDir
247
+ return dest
250
248
case 'darwin' :
251
249
if ( fileInfo !== null && fileInfo . extension == 'dmg' ) {
252
250
core . debug ( `Support for .dmg files is deprecated and may be removed in a future release` )
253
251
await exec . exec ( 'hdiutil' , [ 'attach' , juliaDownloadPath ] )
254
- await exec . exec ( '/bin/bash' , [ '-c' , `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${ tempInstallDir } ` ] )
255
- return path . join ( tempInstallDir , 'julia' )
252
+ await exec . exec ( '/bin/bash' , [ '-c' , `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${ dest } ` ] )
253
+ return path . join ( dest , 'julia' )
256
254
} else {
257
255
// tc.extractTar doesn't support stripping components, so we have to call tar manually
258
- await exec . exec ( 'tar' , [ 'xf' , juliaDownloadPath , '--strip-components=1' , '-C' , tempInstallDir ] )
259
- return tempInstallDir
256
+ await exec . exec ( 'tar' , [ 'xf' , juliaDownloadPath , '--strip-components=1' , '-C' , dest ] )
257
+ return dest
260
258
}
261
259
default :
262
260
throw new Error ( `Platform ${ osPlat } is not supported` )
0 commit comments