Removed code that checks for version less than 1.3.2 as it was not working. Defaulting to zstd without long as that is what is always happening currently.

This commit is contained in:
Lovepreet Singh committed 2023-02-20 13:27:45 +00:00
1 parent 8feecbb839
commit 90e2025fce
1 file changed
+2 -7
+2 -7
View File
@@ -3,7 +3,6 @@ import * as exec from '@actions/exec'
import * as glob from '@actions/glob'
import * as io from '@actions/io'
import * as fs from 'fs'
import { type } from 'os'
import * as path from 'path'
import * as semver from 'semver'
import * as util from 'util'
@@ -100,15 +99,11 @@ export async function getCompressionMethod(): Promise<CompressionMethod> {
const versionOutput = await getVersion('zstd', ['--quiet'])
const version = semver.clean(versionOutput)
if (versionOutput === '') {
if (versionOutput === '' || version === null) {
// zstd is not installed
return CompressionMethod.Gzip
} else if (!version || semver.lt(version, 'v1.3.2')) {
// zstd is installed but using a version earlier than v1.3.2
// v1.3.2 is required to use the `--long` options in zstd
} else{
return CompressionMethod.ZstdWithoutLong
} else {
return CompressionMethod.Zstd
}
}