From 1d1d5456e3c92aeeec8af0404a40baedd7b671d1 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:27:45 +0000 Subject: [PATCH] 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. --- packages/cache/src/internal/cacheUtils.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index b767f963..e2580286 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -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 { 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 } }