fossas / fossa-cli

Fast, portable and reliable dependency analysis for any codebase. Supports license & vulnerability scanning for large monoliths. Language-agnostic; integrates with 20+ build systems.
https://fossa.com
Other
1.29k stars 173 forks source link

Don't suppress curl error messages #1456

Closed jssblck closed 3 months ago

jssblck commented 3 months ago

Overview

curl errors are not surfaced to users. Also, the install-latest script was configuring the wrong setting (HTTP_STATUS instead of http_status).

This PR fixes both issues.

Acceptance criteria

Testing plan

I configured my hosts file:

127.0.0.1 github.com

I validated that curl's error does not appear (other than the --write-out error, which is unrelated):

❯ sudo ./install-latest.sh
fossas/fossa-cli info checking GitHub for latest tag
curl: unknown --write-out variable: 'HTTP_CODE'
fossas/fossa-cli crit unable to find '' - use 'latest' or see https://github.com/fossas/fossa-cli/releases for details

Then I applied the changes in this PR and validated that the curl error does appear (note the curl: (7) text):

❯ sudo ./install-latest.sh
fossas/fossa-cli info checking GitHub for latest tag
curl: (7) Failed to connect to github.com port 443 after 2 ms: Could not connect to server
fossas/fossa-cli err http_download received HTTP status 000 from https://github.com/fossas/fossa-cli/releases/latest
fossas/fossa-cli crit unable to find '' - use 'latest' or see https://github.com/fossas/fossa-cli/releases for details

Risks

None

Metrics

None

References

https://fossa.atlassian.net/browse/ANE-1953

Checklist