add -C - to curl options to prevent downloading files that already exist

This commit is contained in:
emilyd 2022-12-02 16:10:25 +02:00
parent 4789a4a144
commit d9b7061da6

View File

@ -73,7 +73,8 @@ fi
for (( i=0; i<${#package_names[@]}; i++ )); do for (( i=0; i<${#package_names[@]}; i++ )); do
printf "Downloading %s " "${package_names[$i]}" printf "Downloading %s " "${package_names[$i]}"
printf "v%s... " "${package_versions[$i]}" printf "v%s... " "${package_versions[$i]}"
if eval curl -s --output-dir "tmp" -LO "${package_sources[$i]}"; then # "-C -" will prevent curl from downloading files that have already been downloaded
if eval curl -C - -s --output-dir "tmp" -LO "${package_sources[$i]}"; then
printf "%b\n" "$success_message" printf "%b\n" "$success_message"
else else
printf "%b\n" "$error_message" printf "%b\n" "$error_message"