Skip to content

Commit

Permalink
Set executable path if we don't cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimver committed Jan 14, 2024
1 parent 08c2996 commit 5fdf44b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ export async function download(
const url: URL = await getDownloadURL(method, version)
// Get intsaller filename extension depending on OS
const fileExtension: string = getFileExtension(osType)
const downloadDirectory = `cuda_download`
const destFileName = `${toolId}_${version}.${fileExtension}`
// Download executable
const destFilePath = `${downloadDirectory}/${destFileName}`
// Download wexecutable
const downloadPath: string = await tc.downloadTool(
url.toString(),
destFileName
destFilePath
)
if (useLocalCache) {
// Cache download to local machine cache
Expand All @@ -78,9 +80,9 @@ export async function download(
}
if (useGitHubCache) {
// Move file to GitHub cache directory
core.debug(`Copying ${destFileName} to ${cacheDirectory}`)
core.debug(`Copying ${destFilePath} to ${cacheDirectory}`)
await io.mkdirP(cacheDirectory)
await io.mv(destFileName, cacheDirectory)
await io.mv(destFilePath, cacheDirectory)
// Save cache directory to GitHub cache
const cacheId = await cache.saveCache([cacheDirectory], cacheKey)
if (cacheId !== -1) {
Expand All @@ -91,6 +93,7 @@ export async function download(
core.debug(`Tool was moved to cache directory ${cacheDirectory}`)
executableDirectory = cacheDirectory
}
executableDirectory = downloadDirectory
}
core.debug(`Executable path ${executableDirectory}`)
// String with full executable path
Expand Down

0 comments on commit 5fdf44b

Please sign in to comment.