Skip to content

Commit

Permalink
Change output message
Browse files Browse the repository at this point in the history
  • Loading branch information
dusan-trickovic committed Sep 19, 2023
1 parent 31cd255 commit 45c2409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/helpers/__tests__/exec-command-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Command', () => {
const result = await command.execute()
expect(result.stdout).toBe('')
} catch (err) {
expect(err.message).toContain('Command produced empty output.')
expect(err.message).toContain('The command produced an empty output.')
}
})
})
6 changes: 2 additions & 4 deletions packages/helpers/src/exec-command-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export default class CommandHelper {
}

if (this.config.throwOnEmptyOutput && output.stdout.trim() === '') {
this.onError('Command produced empty output.').throw()
this.onError(`The command produced an empty output.`).throw()
}

if (this.config.failOnError && output.stderr) {
this.onError(output.stderr).fail()
}

if (this.config.failOnEmptyOutput && output.stdout.trim() === '') {
this.onError('Command produced empty output.').fail()
this.onError(`The command produced an empty output.`).fail()
}

return output
Expand All @@ -56,8 +56,6 @@ export default class CommandHelper {
throw: () => never
fail: () => void
} {
core.error(`Error occurred: ${errorMessage}`)

return {
throw: () => {
throw new Error(errorMessage)
Expand Down

0 comments on commit 45c2409

Please sign in to comment.