diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f451eb..3495a73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ workflows: - orb-tools/pack: filters: *filters - orb-tools/review: - exclude: RC005 + exclude: RC005,RC007 filters: *filters - shellcheck/check: exclude: SC2148,SC2038,SC2086,SC2002,SC2016 diff --git a/src/scripts/install.sh b/src/scripts/install.sh index 1882aeb..44b2f9e 100644 --- a/src/scripts/install.sh +++ b/src/scripts/install.sh @@ -19,27 +19,43 @@ sudoIfAvailable() { stream() { local url="$1" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO- "$url" + wget --retry-connrefused --waitretry=5 -qO- "$url" || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" + curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error streaming file from $url" >&2 + fi + + return $status } download() { local url="$1" local filename="$2" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO "$filename" "$url" 2>&1 + wget --retry-connrefused --waitretry=5 -qO "$filename" "$url" 2>&1 || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-all-errors --retry-delay 5 -sSLo "$filename" "$url" + curl --retry 5 --retry-all-errors --retry-delay 5 -sSLo "$filename" "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error downloading file from $url to $filename" >&2 + fi + + return $status } os=$(uname) diff --git a/src/scripts/run-build.sh b/src/scripts/run-build.sh index 956aea0..7e205a4 100644 --- a/src/scripts/run-build.sh +++ b/src/scripts/run-build.sh @@ -19,14 +19,22 @@ sudoIfAvailable() { stream() { local url="$1" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO- "$url" + wget --retry-connrefused --waitretry=5 -qO- "$url" || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" + curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error streaming file from $url" >&2 + fi + + return $status } tmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'run-build') diff --git a/src/scripts/run-command.sh b/src/scripts/run-command.sh index b90ce1a..a1f8bea 100644 --- a/src/scripts/run-command.sh +++ b/src/scripts/run-command.sh @@ -19,14 +19,22 @@ sudoIfAvailable() { stream() { local url="$1" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO- "$url" + wget --retry-connrefused --waitretry=5 -qO- "$url" || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" + curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error streaming file from $url" >&2 + fi + + return $status } tmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'run-command') diff --git a/src/scripts/run-tests.sh b/src/scripts/run-tests.sh index a928a95..0b9f469 100644 --- a/src/scripts/run-tests.sh +++ b/src/scripts/run-tests.sh @@ -19,27 +19,43 @@ sudoIfAvailable() { stream() { local url="$1" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO- "$url" + wget --retry-connrefused --waitretry=5 -qO- "$url" || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" + curl --retry 5 --retry-connrefused --retry-delay 5 -sSL "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error streaming file from $url" >&2 + fi + + return $status } download() { local url="$1" local filename="$2" + local status=0 + if command -v wget >/dev/null 2>&1; then - wget --retry-connrefused --waitretry=5 -qO "$filename" "$url" 2>&1 + wget --retry-connrefused --waitretry=5 -qO "$filename" "$url" 2>&1 || status=$? elif command -v curl >/dev/null 2>&1; then - curl --retry 5 --retry-all-errors --retry-delay 5 -sSLo "$filename" "$url" + curl --retry 5 --retry-all-errors --retry-delay 5 -sSLo "$filename" "$url" || status=$? else echo "Could not find wget or curl command" >&2 return 1 fi + + if [ $status -ne 0 ]; then + echo "Error downloading file from $url to $filename" >&2 + fi + + return $status } tmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'run-tests')