Skip to content

Commit 5f03c78

Browse files
jssblckjagonalez
andauthored
Don't suppress curl error messages (#1456)
* Don't suppress curl error messages * update changelog --------- Co-authored-by: Jeremy Gonzalez <[email protected]>
1 parent bc5cc84 commit 5f03c78

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# FOSSA CLI Changelog
22

3+
## Unreleased
4+
5+
- install scripts: Surface curl errors and display http status code correctly. ([#1456](https://github.com/fossas/fossa-cli/pull/1456))
6+
37
## 3.9.28
48

59
- Container Scanning: Distroless containers will now return results for non-system dependencies. ([#1448](https://github.com/fossas/fossa-cli/pull/1448))

install-latest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ http_download_curl() {
257257
source_url=$2
258258
header=$3
259259
if [ -n "$header" ]; then
260-
HTTP_CODE=$(curl -w '%{HTTP_CODE}' -sL -H "$header" -H "Cache-Control: no-cache" -o "$local_file" "$source_url") || (log_debug "curl command failed." && return 1)
260+
HTTP_CODE=$(curl -w '%{http_code}' -sSL -H "$header" -H "Cache-Control: no-cache" -o "$local_file" "$source_url") || (log_debug "curl command failed." && return 1)
261261
fi
262262
if [ -z "$header" ]; then
263-
HTTP_CODE=$(curl -w '%{HTTP_CODE}' -sL -H "Cache-Control: no-cache" -o "$local_file" "$source_url") || (log_debug "curl command failed." && return 1)
263+
HTTP_CODE=$(curl -w '%{http_code}' -sSL -H "Cache-Control: no-cache" -o "$local_file" "$source_url") || (log_debug "curl command failed." && return 1)
264264
fi
265265
return 0
266266
}

install-v1.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ http_download_curl() {
254254
source_url=$2
255255
header=$3
256256
if [ -z "$header" ]; then
257-
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
257+
code=$(curl -w '%{http_code}' -sSL -o "$local_file" "$source_url")
258258
else
259-
code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url")
259+
code=$(curl -w '%{http_code}' -sSL -H "$header" -o "$local_file" "$source_url")
260260
fi
261261
if [ "$code" != "200" ]; then
262262
log_debug "http_download_curl received HTTP status $code"

install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ http_download_curl() {
254254
source_url=$2
255255
header=$3
256256
if [ -z "$header" ]; then
257-
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
257+
code=$(curl -w '%{http_code}' -sSL -o "$local_file" "$source_url")
258258
else
259-
code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url")
259+
code=$(curl -w '%{http_code}' -sSL -H "$header" -o "$local_file" "$source_url")
260260
fi
261261
if [ "$code" != "200" ]; then
262262
log_debug "http_download_curl received HTTP status $code"

0 commit comments

Comments
 (0)