mirror of https://github.com/actions/toolkit
Fix test
parent
bbf5659dfa
commit
6bc5dc5a23
|
@ -365,7 +365,7 @@ test('zstd list tar with windows BSDtar', async () => {
|
||||||
await tar.listTar(archivePath, CompressionMethod.Zstd)
|
await tar.listTar(archivePath, CompressionMethod.Zstd)
|
||||||
|
|
||||||
const tarPath = SystemTarPathOnWindows
|
const tarPath = SystemTarPathOnWindows
|
||||||
expect(execMock).toHaveBeenCalledTimes(1)
|
expect(execMock).toHaveBeenCalledTimes(2)
|
||||||
|
|
||||||
expect(execMock).toHaveBeenNthCalledWith(
|
expect(execMock).toHaveBeenNthCalledWith(
|
||||||
1,
|
1,
|
||||||
|
|
|
@ -180,7 +180,7 @@ async function getDecompressionProgram(
|
||||||
case CompressionMethod.Zstd:
|
case CompressionMethod.Zstd:
|
||||||
return BSD_TAR_ZSTD
|
return BSD_TAR_ZSTD
|
||||||
? [
|
? [
|
||||||
'zstd -d --long=30 -o',
|
'zstd -d --long=30 --force -o',
|
||||||
TarFilename,
|
TarFilename,
|
||||||
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
||||||
]
|
]
|
||||||
|
@ -191,7 +191,7 @@ async function getDecompressionProgram(
|
||||||
case CompressionMethod.ZstdWithoutLong:
|
case CompressionMethod.ZstdWithoutLong:
|
||||||
return BSD_TAR_ZSTD
|
return BSD_TAR_ZSTD
|
||||||
? [
|
? [
|
||||||
'zstd -d -o',
|
'zstd -d --force -o',
|
||||||
TarFilename,
|
TarFilename,
|
||||||
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
|
||||||
]
|
]
|
||||||
|
@ -219,7 +219,7 @@ async function getCompressionProgram(
|
||||||
case CompressionMethod.Zstd:
|
case CompressionMethod.Zstd:
|
||||||
return BSD_TAR_ZSTD
|
return BSD_TAR_ZSTD
|
||||||
? [
|
? [
|
||||||
'zstd -T0 --long=30 -o',
|
'zstd -T0 --long=30 --force -o',
|
||||||
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
||||||
TarFilename
|
TarFilename
|
||||||
]
|
]
|
||||||
|
@ -230,7 +230,7 @@ async function getCompressionProgram(
|
||||||
case CompressionMethod.ZstdWithoutLong:
|
case CompressionMethod.ZstdWithoutLong:
|
||||||
return BSD_TAR_ZSTD
|
return BSD_TAR_ZSTD
|
||||||
? [
|
? [
|
||||||
'zstd -T0 -o',
|
'zstd -T0 --force -o',
|
||||||
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
cacheFileName.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
|
||||||
TarFilename
|
TarFilename
|
||||||
]
|
]
|
||||||
|
@ -245,7 +245,9 @@ async function execCommands(commands: string[], cwd?: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await exec(command, undefined, {cwd})
|
await exec(command, undefined, {cwd})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`${command[0]} failed with error: ${error?.message}`)
|
throw new Error(
|
||||||
|
`${command.split(' ')[0]} failed with error: ${error?.message}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue