Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script returns exit code 0 even if install fails #1566

Closed
blowfishpro opened this issue Feb 13, 2023 · 0 comments · Fixed by #1915
Closed

Install script returns exit code 0 even if install fails #1566

blowfishpro opened this issue Feb 13, 2023 · 0 comments · Fixed by #1915
Labels
bug Something isn't working good-first-issue Good for newcomers

Comments

@blowfishpro
Copy link

Please provide a set of steps on how to reproduce the issue

  • Attempt to install syft via the recommended method (curl piped to sh)
  • Have some issue that would cause the installation to fail (e.g. no permissions on the target directory)

What happened:

  • The installation script exits with code 0 (verified this wasn't a pipe issue etc)

What you expected to happen:

  • The installation script exits with a nonzero code when it fails

Anything else we need to know?:

  • Since the install script does not set -e, perhaps this should store the exit code and then return it later?

Environment:

  • Output of syft version: n/a
  • OS (e.g: cat /etc/os-release or similar): Tested on Unbutu but it shouldn't really matter
@blowfishpro blowfishpro added the bug Something isn't working label Feb 13, 2023
@tgerla tgerla added the good-first-issue Good for newcomers label Feb 16, 2023
lorsatti added a commit to lorsatti/syft that referenced this issue Jul 5, 2023
This resolves anchore#1566.

Signed-off-by: Lorenzo Orsatti < 49567430+lorsatti@users.noreply.github.com>
lorsatti added a commit to lorsatti/syft that referenced this issue Jul 5, 2023
This resolves anchore#1566.

Signed-off-by: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com>
spiffcs added a commit that referenced this issue Jul 6, 2023
This resolves #1566.

Signed-off-by: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com>
Co-authored-by: Christopher Phillips <cphillips918@gmail.com>
GijsCalis pushed a commit to GijsCalis/syft that referenced this issue Feb 19, 2024
This resolves anchore#1566.

Signed-off-by: Lorenzo Orsatti <49567430+lorsatti@users.noreply.github.com>
Co-authored-by: Christopher Phillips <cphillips918@gmail.com>
hacst added a commit to hacst/syft that referenced this issue Feb 22, 2024
Previously exit was called with the stdout content of
the main function. This did not make sense and
resulted in the script not returning the expected
exit codes when main returned a non-zero code.

Strangely enough this broken code was introduced in
response to anchore#1566 but I do not see how it ever worked
unless the script used to echo its intended exit code.
hacst added a commit to hacst/syft that referenced this issue Feb 22, 2024
Previously exit was called with the stdout content of
the main function. This did not make sense and
resulted in the script not returning the expected
exit codes when main returned a non-zero code.

Strangely enough this broken code was introduced in
response to anchore#1566 but I do not see how it ever worked
unless the script used to echo its intended exit code.

Signed-off-by: Stefan Hacker <mail@hacst.net>
hacst added a commit to hacst/syft that referenced this issue Feb 22, 2024
Previously exit was called with the stdout content of
the main function. This did not make sense and
resulted in the script not returning the expected
exit codes when main returned a non-zero code.

Strangely enough this broken code was introduced in
response to anchore#1566 but I do not see how it ever worked
unless the script used to echo its intended exit code.

Signed-off-by: Stefan Hacker <mail@hacst.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants