mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-11-18 18:51:13 +08:00
Add default value and rename args
This commit is contained in:
parent
6ec51745ad
commit
cf3dd065b8
9
packages/cache/src/internal/cacheUtils.ts
vendored
9
packages/cache/src/internal/cacheUtils.ts
vendored
@ -71,13 +71,12 @@ export async function unlinkFile(filePath: fs.PathLike): Promise<void> {
|
||||
return util.promisify(fs.unlink)(filePath)
|
||||
}
|
||||
|
||||
async function getVersion(app: string, args?: string[]): Promise<string> {
|
||||
async function getVersion(app: string, additionalArgs: string[] = []): Promise<string> {
|
||||
let versionOutput = ''
|
||||
typeof args !== 'undefined' ? args : (args = [])
|
||||
args.push('--version')
|
||||
core.debug(`Checking ${app} ${args.join(' ')}`)
|
||||
additionalArgs.push('--version')
|
||||
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`)
|
||||
try {
|
||||
await exec.exec(`${app}`, args, {
|
||||
await exec.exec(`${app}`, additionalArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
listeners: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user