From 652109d32c9e7257ff1544a53629e2b0cdb6fb0b Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 10:30:41 +0000 Subject: [PATCH] Test passing quiet as argument --- packages/cache/src/internal/cacheUtils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 02a2e98e..e413d10d 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -3,6 +3,7 @@ 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' @@ -71,11 +72,13 @@ export async function unlinkFile(filePath: fs.PathLike): Promise { return util.promisify(fs.unlink)(filePath) } -async function getVersion(app: string): Promise { +async function getVersion(app: string, args?: string[]): Promise { core.debug(`Checking ${app} --version`) let versionOutput = '' + typeof args !== 'undefined' ? args : (args = []) + args.push('--version') try { - await exec.exec(`${app} --version`, [], { + await exec.exec(`${app}`, args, { ignoreReturnCode: true, silent: true, listeners: { @@ -94,7 +97,7 @@ async function getVersion(app: string): Promise { // Use zstandard if possible to maximize cache performance export async function getCompressionMethod(): Promise { - const versionOutput = await getVersion('zstd') + const versionOutput = await getVersion('zstd', ['--quiet']) core.debug(`versionOutput: ${versionOutput}`) const version = semver.clean(versionOutput) core.debug(`version: ${version}`)