Skip to content

Commit

Permalink
Simplify promise rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
luketomlinson committed May 7, 2021
1 parent ae2eb2e commit c0f1ad9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Binary file removed packages/exec/actions-exec-1.0.4.tgz
Binary file not shown.
10 changes: 1 addition & 9 deletions packages/exec/src/toolrunner.ts
Expand Up @@ -421,10 +421,6 @@ export class ToolRunner extends events.EventEmitter {
this._debug(` ${arg}`)
}

this.on('error', (error: Error) => {
reject(error)
})

const optionsNonNull = this._cloneExecOptions(this.options)
if (!optionsNonNull.silent && optionsNonNull.outStream) {
optionsNonNull.outStream.write(
Expand All @@ -438,11 +434,7 @@ export class ToolRunner extends events.EventEmitter {
})

if (this.options.cwd && !(await ioUtil.exists(this.options.cwd))) {
this.emit(
'error',
new Error(`The cwd: ${this.options.cwd} does not exist!`)
)
return
return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`))
}

const fileName = this._getSpawnFileName()
Expand Down

0 comments on commit c0f1ad9

Please sign in to comment.