diff --git a/dist/setup/index.js b/dist/setup/index.js index 51b882c..3c46b40 100644 Binary files a/dist/setup/index.js and b/dist/setup/index.js differ diff --git a/src/download/download-latest.ts b/src/download/download-latest.ts index b7c4a97..3dcad7a 100644 --- a/src/download/download-latest.ts +++ b/src/download/download-latest.ts @@ -29,8 +29,8 @@ export async function downloadLatest( let uvExecutablePath: string let uvDir: string if (platform === 'pc-windows-msvc') { - const extractedDir = await tc.extractZip(downloadPath) - uvDir = path.join(extractedDir, artifact) + uvDir = await tc.extractZip(downloadPath) + // On windows extracting the zip does not create an intermediate directory uvExecutablePath = path.join(uvDir, 'uv.exe') } else { const extractedDir = await tc.extractTar(downloadPath) diff --git a/src/download/download-version.ts b/src/download/download-version.ts index 645d329..33eb09c 100644 --- a/src/download/download-version.ts +++ b/src/download/download-version.ts @@ -5,11 +5,6 @@ import {OWNER, REPO, TOOL_CACHE_NAME} from '../utils/utils' import {Architecture, Platform} from '../utils/platforms' import {validateChecksum} from './checksum/checksum' -import * as fs from 'fs' -import * as util from 'util' - -const readdir = util.promisify(fs.readdir) - export function tryGetFromToolCache( arch: Architecture, version: string @@ -43,24 +38,14 @@ export async function downloadVersion( ) await validateChecksum(checkSum, downloadPath, arch, platform, version) - let extractedDir: string + let uvDir: string if (platform === 'pc-windows-msvc') { - extractedDir = await tc.extractZip(downloadPath) - const files = await readdir(extractedDir) - core.info( - `Contents of extracted directory ${extractedDir}: ${files.join(', ')}` - ) - const uvDir = path.join(extractedDir, artifact) - const uvfiles = await readdir(uvDir) - core.info(`Contents of directory ${uvDir}: ${uvfiles.join(', ')}`) + uvDir = await tc.extractZip(downloadPath) + // On windows extracting the zip does not create an intermediate directory } else { - extractedDir = await tc.extractTar(downloadPath) + const extractedDir = await tc.extractTar(downloadPath) + uvDir = path.join(extractedDir, artifact) } - return await tc.cacheDir( - path.join(extractedDir, artifact), - TOOL_CACHE_NAME, - version, - arch - ) + return await tc.cacheDir(uvDir, TOOL_CACHE_NAME, version, arch) }