From 850085c7e1d183bd47e7a982f9c137b3333c5aaf Mon Sep 17 00:00:00 2001 From: Katia Esposito Date: Mon, 1 Jul 2024 12:16:58 +0200 Subject: [PATCH] test partial files --- manifests/update.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manifests/update.sh b/manifests/update.sh index 70f1f0b..c166311 100755 --- a/manifests/update.sh +++ b/manifests/update.sh @@ -162,6 +162,21 @@ for POD in $PODS; do # Delete the original tar rm "$TARNAME" fi + SHOULD_SKIP=0 + # check if these split files exist in the release, if they do, skip + for FILE in $(ls "$TMPTAR"); do + FILE_URL="https://github.com/adsblol/globe_history_$CURRENT_YEAR/releases/download/$RELEASE_NAME/$FILE" + if curl -s --head $FILE_URL | head -n 1 | grep "HTTP/[123][.1]* [23].." > /dev/null; then + echo "[ info] $FILE_URL has already been backed up. Skipping." + SHOULD_SKIP=$((SHOULD_SKIP+1)) + fi + done + # if SHOULD_SKIP is the same as the n of files, skip + if [ $SHOULD_SKIP -eq $(ls "$TMPTAR" | wc -l) ]; then + echo "[ info] All files have already been backed up. Skipping." + rm -rf "$TMPTAR" "$TMP_FOLDER" + continue + fi # 5.5. Upload the tar to GitHub releases README=$(echo '```' && cat "$TMP_FOLDER/README.txt" && echo '```') github-release adsblol/globe_history_$CURRENT_YEAR "$RELEASE_NAME" main "$README" "$TMPTAR/*"