mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-08 02:27:26 +00:00
Use tar for extracting the uv zip file on Windows too
Use extractTar() instead of extractZip() which is very slow for some reason (0.3s vs 10s) Fixes #659
This commit is contained in:
parent
2ddd2b9cb3
commit
1cd7d04150
2 changed files with 2 additions and 9 deletions
6
dist/setup/index.js
generated
vendored
6
dist/setup/index.js
generated
vendored
|
|
@ -129171,7 +129171,6 @@ exports.tryGetFromToolCache = tryGetFromToolCache;
|
|||
exports.downloadVersionFromGithub = downloadVersionFromGithub;
|
||||
exports.downloadVersionFromManifest = downloadVersionFromManifest;
|
||||
exports.resolveVersion = resolveVersion;
|
||||
const node_fs_1 = __nccwpck_require__(73024);
|
||||
const path = __importStar(__nccwpck_require__(76760));
|
||||
const core = __importStar(__nccwpck_require__(37484));
|
||||
const tc = __importStar(__nccwpck_require__(33472));
|
||||
|
|
@ -129211,12 +129210,9 @@ async function downloadVersion(downloadUrl, artifactName, platform, arch, versio
|
|||
const downloadPath = await tc.downloadTool(downloadUrl, undefined, githubToken);
|
||||
await (0, checksum_1.validateChecksum)(checkSum, downloadPath, arch, platform, version);
|
||||
let uvDir;
|
||||
const extension = getExtension(platform);
|
||||
if (platform === "pc-windows-msvc") {
|
||||
const fullPathWithExtension = `${downloadPath}${extension}`;
|
||||
await node_fs_1.promises.copyFile(downloadPath, fullPathWithExtension);
|
||||
uvDir = await tc.extractZip(fullPathWithExtension);
|
||||
// On windows extracting the zip does not create an intermediate directory
|
||||
uvDir = await tc.extractTar(downloadPath, undefined, "x");
|
||||
}
|
||||
else {
|
||||
const extractedDir = await tc.extractTar(downloadPath);
|
||||
|
|
|
|||
|
|
@ -108,12 +108,9 @@ async function downloadVersion(
|
|||
await validateChecksum(checkSum, downloadPath, arch, platform, version);
|
||||
|
||||
let uvDir: string;
|
||||
const extension = getExtension(platform);
|
||||
if (platform === "pc-windows-msvc") {
|
||||
const fullPathWithExtension = `${downloadPath}${extension}`;
|
||||
await fs.copyFile(downloadPath, fullPathWithExtension);
|
||||
uvDir = await tc.extractZip(fullPathWithExtension);
|
||||
// On windows extracting the zip does not create an intermediate directory
|
||||
uvDir = await tc.extractTar(downloadPath, undefined, "x");
|
||||
} else {
|
||||
const extractedDir = await tc.extractTar(downloadPath);
|
||||
uvDir = path.join(extractedDir, artifactName);
|
||||
|
|
|
|||
Loading…
Reference in a new issue