File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,13 @@ download() {
46
46
47
47
if curl -s -f -L -o ${tmp_file} " $1 " ; then
48
48
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
51
56
else
52
57
echo " Error: Curl has failed to download the file"
53
58
echo " Removing temporary file ${tmp_file} "
@@ -94,7 +99,7 @@ download-signature-verify() {
94
99
download-size-verify " $source " " $path "
95
100
elif [[ " $verify_exit " -eq " 1" ]]; then
96
101
echo " $verify_output "
97
- download " $source " " $path "
102
+ download " $source " " $path " || return 1
98
103
echo " Verifying ${path} ..."
99
104
verify-file " ${path} .asc" " $path "
100
105
fi
You can’t perform that action at this time.
0 commit comments