From d9b7061da6d0eda4d16c1a76174c466a6ebbfa89 Mon Sep 17 00:00:00 2001 From: emilyd Date: Fri, 2 Dec 2022 16:10:25 +0200 Subject: [PATCH] add -C - to curl options to prevent downloading files that already exist --- profiles/base/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/base/build.sh b/profiles/base/build.sh index c769bd2..1df643f 100755 --- a/profiles/base/build.sh +++ b/profiles/base/build.sh @@ -73,7 +73,8 @@ fi for (( i=0; i<${#package_names[@]}; i++ )); do printf "Downloading %s " "${package_names[$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" else printf "%b\n" "$error_message"