File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,13 @@ download() {
4646
4747 if curl -s -f -L -o ${tmp_file} " $1 " ; then
4848 echo " Moving ${tmp_file} to target path ${2} "
49- mv " ${tmp_file} " " $2 "
50- return 0
49+
50+ # Perform the move. If it doesn't work, clean up and return an error
51+ if ! mv " ${tmp_file} " " $2 " ; then
52+ echo " Failed to move ${tmp_file} to ${2} ! Deleting temporary file"
53+ rm " ${tmp_file} "
54+ return 1
55+ fi
5156 else
5257 echo " Error: Curl has failed to download the file"
5358 echo " Removing temporary file ${tmp_file} "
@@ -94,7 +99,7 @@ download-signature-verify() {
9499 download-size-verify " $source " " $path "
95100 elif [[ " $verify_exit " -eq " 1" ]]; then
96101 echo " $verify_output "
97- download " $source " " $path "
102+ download " $source " " $path " || return 1
98103 echo " Verifying ${path} ..."
99104 verify-file " ${path} .asc" " $path "
100105 fi
You can’t perform that action at this time.
0 commit comments