1
0
Fork 0

Fix tar operations

bishal-change
Lovepreet Singh 2022-11-16 20:50:04 +00:00
parent db3517fe3b
commit 27bf8304ea
1 changed files with 3 additions and 6 deletions

View File

@ -64,9 +64,7 @@ async function getCompressionProgram(compressionMethod: CompressionMethod): Prom
switch (compressionMethod) { switch (compressionMethod) {
case CompressionMethod.Zstd: case CompressionMethod.Zstd:
if (BSD_TAR_ZSTD) { if (BSD_TAR_ZSTD) {
return [ return ['-a'] // auto-detect compression
'-O', '|','zstd -d --long=30 -o'
]
} }
return [ return [
'--use-compress-program', '--use-compress-program',
@ -74,9 +72,7 @@ async function getCompressionProgram(compressionMethod: CompressionMethod): Prom
] ]
case CompressionMethod.ZstdWithoutLong: case CompressionMethod.ZstdWithoutLong:
if (BSD_TAR_ZSTD) { if (BSD_TAR_ZSTD) {
return [ return ['a'] // auto-detect compression
'-O', '|', 'zstd -d --long=30 -o'
]
} }
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd'] return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd']
default: default:
@ -168,6 +164,7 @@ export async function createTar(
workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), workingDirectory.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
'--files-from', '--files-from',
manifestFilename, manifestFilename,
'-cf',
...(await getCompressionProgram()), ...(await getCompressionProgram()),
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'), cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),