From 2d3c79e6fe27dc9096e36f52834b6bdc9fbd9167 Mon Sep 17 00:00:00 2001 From: Sampark Sharma Date: Mon, 12 Dec 2022 12:18:07 +0000 Subject: [PATCH] Address review comments --- .github/workflows/cache-windows-test.yml | 1 + packages/cache/__tests__/tar.test.ts | 6 +++--- packages/cache/src/internal/tar.ts | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache-windows-test.yml b/.github/workflows/cache-windows-test.yml index 3868f296..c7f7a5a9 100644 --- a/.github/workflows/cache-windows-test.yml +++ b/.github/workflows/cache-windows-test.yml @@ -78,6 +78,7 @@ jobs: run: | rm -rf test-cache rm -rf ~/test-cache + rm -f cache.tar - name: Restore cache using restoreCache() with Azure SDK run: | diff --git a/packages/cache/__tests__/tar.test.ts b/packages/cache/__tests__/tar.test.ts index a33f4fab..a6a79a3d 100644 --- a/packages/cache/__tests__/tar.test.ts +++ b/packages/cache/__tests__/tar.test.ts @@ -99,7 +99,7 @@ test('zstd extract tar with windows BSDtar', async () => { expect(execMock).toHaveBeenNthCalledWith( 1, [ - 'zstd -d --long=30 --force -o', + 'zstd -d --long=30 -o', TarFilename.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/') ].join(' '), @@ -273,7 +273,7 @@ test('zstd create tar with windows BSDtar', async () => { expect(execMock).toHaveBeenNthCalledWith( 2, [ - 'zstd -T0 --long=30 --force -o', + 'zstd -T0 --long=30 -o', CacheFilename.Zstd.replace(/\\/g, '/'), TarFilename.replace(/\\/g, '/') ].join(' '), @@ -370,7 +370,7 @@ test('zstd list tar with windows BSDtar', async () => { expect(execMock).toHaveBeenNthCalledWith( 1, [ - 'zstd -d --long=30 --force -o', + 'zstd -d --long=30 -o', TarFilename.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/') ].join(' '), diff --git a/packages/cache/src/internal/tar.ts b/packages/cache/src/internal/tar.ts index 0af6a87a..0da4e8df 100644 --- a/packages/cache/src/internal/tar.ts +++ b/packages/cache/src/internal/tar.ts @@ -183,7 +183,7 @@ async function getDecompressionProgram( case CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ - 'zstd -d --long=30 --force -o', + 'zstd -d --long=30 -o', TarFilename, archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/') ] @@ -194,7 +194,7 @@ async function getDecompressionProgram( case CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ - 'zstd -d --force -o', + 'zstd -d -o', TarFilename, archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/') ] @@ -223,7 +223,7 @@ async function getCompressionProgram( case CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ - 'zstd -T0 --long=30 --force -o', + 'zstd -T0 --long=30 -o', cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), TarFilename ] @@ -234,7 +234,7 @@ async function getCompressionProgram( case CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ - 'zstd -T0 --force -o', + 'zstd -T0 -o', cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), TarFilename ]