From 9366237c904b6ff20682f2204e8f9d9cac467ddb Mon Sep 17 00:00:00 2001 From: Sampark Sharma Date: Mon, 7 Nov 2022 13:39:07 +0000 Subject: [PATCH] Add gnuTar as default in windows --- packages/cache/src/internal/tar.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cache/src/internal/tar.ts b/packages/cache/src/internal/tar.ts index 2e28ca1a..3b351414 100644 --- a/packages/cache/src/internal/tar.ts +++ b/packages/cache/src/internal/tar.ts @@ -14,7 +14,11 @@ async function getTarPath( switch (process.platform) { case 'win32': { const systemTar = `${process.env['windir']}\\System32\\tar.exe` - if (compressionMethod !== CompressionMethod.Gzip) { + const gnuTar = `${process.env['windir']}\\Program Files\\Git\\usr\\bin\\tar.exe` + if (compressionMethod !== CompressionMethod.Gzip && existsSync(gnuTar)) { + args.push('--force-local') + return gnuTar + } else if (compressionMethod !== CompressionMethod.Gzip) { // We only use zstandard compression on windows when gnu tar is installed due to // a bug with compressing large files with bsdtar + zstd args.push('--force-local')