Skip to content

Commit

Permalink
Fix failing test cases on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lvpx committed Aug 17, 2022
1 parent 6e888c8 commit 98a4069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/cache/__tests__/tar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('zstd extract tar', async () => {
`"${defaultTarPath}"`,
[
'--use-compress-program',
'unzstd --long=30',
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30',
'-xf',
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
'-P',
Expand Down Expand Up @@ -140,7 +140,7 @@ test('zstd create tar', async () => {
[
'--posix',
'--use-compress-program',
'zstdmt --long=30',
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30',
'-cf',
IS_WINDOWS ? CacheFilename.Zstd.replace(/\\/g, '/') : CacheFilename.Zstd,
'--exclude',
Expand Down Expand Up @@ -210,7 +210,7 @@ test('zstd list tar', async () => {
`"${defaultTarPath}"`,
[
'--use-compress-program',
'unzstd --long=30',
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30',
'-tf',
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
'-P'
Expand All @@ -235,7 +235,7 @@ test('zstdWithoutLong list tar', async () => {
`"${defaultTarPath}"`,
[
'--use-compress-program',
'unzstd',
IS_WINDOWS ? 'zstd -d' : 'unzstd',
'-tf',
IS_WINDOWS ? archivePath.replace(/\\/g, '/') : archivePath,
'-P'
Expand Down
12 changes: 6 additions & 6 deletions packages/cache/src/internal/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export async function extractTar(
switch (compressionMethod) {
case CompressionMethod.Zstd:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -d --long=30']
return ['--use-compress-program', 'zstd -d --long=30']
}
return ['--use-compress-program', 'unzstd --long=30']
case CompressionMethod.ZstdWithoutLong:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -d']
return ['--use-compress-program', 'zstd -d']
}
return ['--use-compress-program', 'unzstd']
default:
Expand Down Expand Up @@ -115,12 +115,12 @@ export async function createTar(
switch (compressionMethod) {
case CompressionMethod.Zstd:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -T0 --long=30']
return ['--use-compress-program', 'zstd -T0 --long=30']
}
return ['--use-compress-program', 'zstdmt --long=30']
case CompressionMethod.ZstdWithoutLong:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -T0']
return ['--use-compress-program', 'zstd -T0']
}
return ['--use-compress-program', 'zstdmt']
default:
Expand Down Expand Up @@ -156,12 +156,12 @@ export async function listTar(
switch (compressionMethod) {
case CompressionMethod.Zstd:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -d --long=30']
return ['--use-compress-program', 'zstd -d --long=30']
}
return ['--use-compress-program', 'unzstd --long=30']
case CompressionMethod.ZstdWithoutLong:
if (process.platform === 'win32') {
return ['--use-compress-program=zstd -d']
return ['--use-compress-program', 'zstd -d']
}
return ['--use-compress-program', 'unzstd']
default:
Expand Down

0 comments on commit 98a4069

Please sign in to comment.