From cd5975c0d0f46a14eb817612f54c455a9f053bde Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Fri, 16 May 2025 09:38:00 +0100 Subject: [PATCH] Only try to copy files if some exist, otherwise it casues an error --- scripts/get-changelogs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/get-changelogs.sh b/scripts/get-changelogs.sh index 9bc6371..32c3ca9 100755 --- a/scripts/get-changelogs.sh +++ b/scripts/get-changelogs.sh @@ -19,7 +19,10 @@ mkdir -p "$PROCESSING_DIR" # Download only .md files from S3 aws s3 sync "s3://$S3_BUCKET/$S3_PREFIX" "$LOCAL_DIR" --exclude "*" --include "*.md" -cp "$LOCAL_DIR"/*.md "$PROCESSING_DIR" +# Only copy if there are .md files +if ls "$LOCAL_DIR"/*.md 1> /dev/null 2>&1; then + cp "$LOCAL_DIR"/*.md "$PROCESSING_DIR" +fi # Process downloaded files: update H1 header to only the last semantic version after "vs. " for file in "$PROCESSING_DIR"/*.md; do