mirror of https://github.com/actions/toolkit
Add default value and rename args
parent
6ec51745ad
commit
cf3dd065b8
|
@ -71,13 +71,12 @@ export async function unlinkFile(filePath: fs.PathLike): Promise<void> {
|
||||||
return util.promisify(fs.unlink)(filePath)
|
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 = ''
|
let versionOutput = ''
|
||||||
typeof args !== 'undefined' ? args : (args = [])
|
additionalArgs.push('--version')
|
||||||
args.push('--version')
|
core.debug(`Checking ${app} ${additionalArgs.join(' ')}`)
|
||||||
core.debug(`Checking ${app} ${args.join(' ')}`)
|
|
||||||
try {
|
try {
|
||||||
await exec.exec(`${app}`, args, {
|
await exec.exec(`${app}`, additionalArgs, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
|
|
Loading…
Reference in New Issue