mirror of https://github.com/actions/toolkit
Fix tar operations
parent
db3517fe3b
commit
27bf8304ea
|
@ -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'), '/'),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue