Skip to content

Commit

Permalink
chore(exec): also set empty string on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Aug 29, 2023
1 parent e3e1a4c commit 8754b12
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/common",
"version": "4.8.0",
"version": "4.9.0",
"description": "The Athenna common helpers to use in any Node.js ESM project.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
8 changes: 8 additions & 0 deletions src/helpers/Exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ export class Exec {

return result
} catch (error) {
if (!error.stdout) {
error.stdout = ''
}

if (!error.stderr) {
error.stderr = ''
}

debug('command has failed')
debug('command stdout: %s', error.stdout)
debug('command stderr: %s', error.stderr)
Expand Down

0 comments on commit 8754b12

Please sign in to comment.