devo-ps / pipelines

Build pipelines for automation, deployment, testing...
MIT License
119 stars 13 forks source link

`Bash` type bug #141

Closed guinan34 closed 2 years ago

guinan34 commented 2 years ago

when using Bash type in pipeline as an action task. if the shell returned an exit code . such as 3 or 4 or others. the pipeline will returned an error as below first screenshot shown . i checked the source code found the the bash module exception handle section has some issues need to fix.

image image
sp3c73r2038 commented 2 years ago

https://github.com/amoffat/sh/blob/1.14.2/sh.py#L337-L399 as you can see, ErrorReturnCode only has full_cmd/stdout/stderr/truncate properties. it should use str(e) here.

and e.exitcode do exist when the exception is an instance of ErrorReturnCode${exit_code} like ErrorReturnCode_4 in this case.

I think it will be a easy fix.