@actions/cache
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -110,8 +110,9 @@ "use strict"; | ||
exports.unlinkFile = unlinkFile; | ||
function getVersion(app) { | ||
function getVersion(app, additionalArgs = []) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
core.debug(`Checking ${app} --version`); | ||
let versionOutput = ''; | ||
additionalArgs.push('--version'); | ||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`); | ||
try { | ||
yield exec.exec(`${app} --version`, [], { | ||
yield exec.exec(`${app}`, additionalArgs, { | ||
ignoreReturnCode: true, | ||
@@ -136,16 +137,11 @@ silent: true, | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const versionOutput = yield getVersion('zstd'); | ||
const versionOutput = yield getVersion('zstd', ['--quiet']); | ||
const version = semver.clean(versionOutput); | ||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) { | ||
// zstd is not installed | ||
core.debug(`zstd version: ${version}`); | ||
if (versionOutput === '') { | ||
return constants_1.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 constants_1.CompressionMethod.ZstdWithoutLong; | ||
} | ||
else { | ||
return constants_1.CompressionMethod.Zstd; | ||
} | ||
}); | ||
@@ -152,0 +148,0 @@ } |
{ | ||
"name": "@actions/cache", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"preview": true, | ||
@@ -5,0 +5,0 @@ "description": "Actions cache lib", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112071
1583