Skip to content

Commit 87342b4

Browse files
committed
using the curl's exit code instead of its output
1 parent b1ec230 commit 87342b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: tasks/download.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ download() {
3838
printf '%s\n' "Downloading: ${1}"
3939
tmp_file=$(mktemp "peadm-download.XXX")
4040
echo "Temporary file created at: ${tmp_file}"
41-
download_file=$(curl -s -f -L -o ${tmp_file} "$1")
42-
if [[ -z "$download_file" ]]; then
41+
42+
if curl -s -f -L -o ${tmp_file} "$1"; then
4343
mv "${tmp_file}" "$2"
4444
return 0
4545
else
4646
echo "Error: Curl has failed to download the file"
47-
echo "|_ Removing temporary file: ${tmp_file}"
47+
echo "Removing temporary file: ${tmp_file}"
4848
rm "${tmp_file}"
4949
return 1
5050
fi

0 commit comments

Comments
 (0)