@@ -1152,12 +1152,13 @@ function unlinkFile(filePath) {
11521152 });
11531153}
11541154exports.unlinkFile = unlinkFile;
1155- function getVersion(app) {
1155+ function getVersion(app, additionalArgs = [] ) {
11561156 return __awaiter(this, void 0, void 0, function* () {
1157- core.debug(`Checking ${app} --version`);
11581157 let versionOutput = '';
1158+ additionalArgs.push('--version');
1159+ core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);
11591160 try {
1160- yield exec.exec(`${app} --version `, [] , {
1161+ yield exec.exec(`${app}`, additionalArgs , {
11611162 ignoreReturnCode: true,
11621163 silent: true,
11631164 listeners: {
@@ -1177,19 +1178,14 @@ function getVersion(app) {
11771178// Use zstandard if possible to maximize cache performance
11781179function getCompressionMethod() {
11791180 return __awaiter(this, void 0, void 0, function* () {
1180- const versionOutput = yield getVersion('zstd');
1181+ const versionOutput = yield getVersion('zstd', ['--quiet'] );
11811182 const version = semver.clean(versionOutput);
1182- if (!versionOutput.toLowerCase().includes(' zstd command line interface')) {
1183- // zstd is not installed
1183+ core.debug(` zstd version: ${version}`);
1184+ if (versionOutput === '') {
11841185 return constants_1.CompressionMethod.Gzip;
11851186 }
1186- else if (!version || semver.lt(version, 'v1.3.2')) {
1187- // zstd is installed but using a version earlier than v1.3.2
1188- // v1.3.2 is required to use the `--long` options in zstd
1189- return constants_1.CompressionMethod.ZstdWithoutLong;
1190- }
11911187 else {
1192- return constants_1.CompressionMethod.Zstd ;
1188+ return constants_1.CompressionMethod.ZstdWithoutLong ;
11931189 }
11941190 });
11951191}
0 commit comments