Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

gnomon swallows errors #12

Open
AndreiShostik opened this issue Feb 27, 2018 · 2 comments
Open

gnomon swallows errors #12

AndreiShostik opened this issue Feb 27, 2018 · 2 comments

Comments

@AndreiShostik
Copy link

AndreiShostik commented Feb 27, 2018

just an example during linting

without gnomon:

  cmd: 'npm run lint',
  timedOut: false,
  exitCode: 1 }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Exit status 1
npm ERR! 
...

Process finished with exit code 1

with gnomon:

  cmd: 'npm run lint',
  timedOut: false,
  exitCode: 1 }
   0.3374s   project: Lint errors found in the listed files.
             
     Total   37.5537s

Process finished with exit code 0
@vyncentk
Copy link

Hi,
you could do it like that :

npm run lint | gnomon ; test ${PIPESTATUS[0]} -eq 0

$PIPESTATUS hold all command piped exit status :)

@AndreiShostik
Copy link
Author

AndreiShostik commented Mar 22, 2018

@vyncentk thanks for your reply
I tried that but haven't got any success. rather it is not a problem of gnomon itself but my gaps in knowledge of Linux

probably something more hides from me a result from pipe operation

if I run commands with pipe under npm:

$ npm run lint
> papaya@0.1.0 lint D:\work\payaya
> lerna run lint --stream | gnomon --medium=5 --high=10 --real-time=false; echo ${PIPESTATUS[@]}
...

it shows nothing to me.
also tried to throw an exit code manually:

$ npm run lint; echo ${PIPESTATUS[@]}
> papaya@0.1.0 lint D:\work\payaya
> lerna run lint --stream | gnomon --medium=5 --high=10 --real-time=false; test ${PIPESTATUS[0]} -eq 0 || exit 1
> 0

but if I run directly:

$ lerna run lint --stream | gnomon --medium=5 --high=10 --real-time=false; echo ${PIPESTATUS[@]}
> 1 0

it shows what I expected

maybe you know how to traverse an exit code above?

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants