export async function setCachedToolPath()

in src/utilities.ts [68:99]


export async function setCachedToolPath(toolName: string, version: string) {
   let cachedToolpath = ''
   let downloadPath = ''
   const downloadUrl = getDownloadUrl(toolName, version)

   try {
      downloadPath = await toolCache.downloadTool(downloadUrl)
   } catch (exeption) {
      throw new Error(
         `Failed to download the ${toolName} from ${downloadUrl}.  Error: ${exeption}`
      )
   }

   if (toolName == 'helm') {
      fs.chmodSync(downloadPath, '777')
      const unzipedHelmPath = await toolCache.extractZip(downloadPath)
      cachedToolpath = await toolCache.cacheDir(
         unzipedHelmPath,
         toolName,
         version
      )
   } else {
      cachedToolpath = await toolCache.cacheFile(
         downloadPath,
         toolName + getExecutableExtension(),
         toolName,
         version
      )
   }

   return cachedToolpath
}