Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change output message
  • Loading branch information
dusan-trickovic committed Sep 19, 2023
commit 45c24094535a9855a4a44c8fe87b658b49cfee6d
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