From 209f058e77a61e31805e63f39c79dcdbc112c0ef Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 7 Feb 2024 17:14:06 +1100 Subject: [PATCH] Updated the 'upload exists' script with the latest fixes --- scripts/drone-upload-exists.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/drone-upload-exists.sh b/scripts/drone-upload-exists.sh index 1e2db10e1..bc9b112c2 100755 --- a/scripts/drone-upload-exists.sh +++ b/scripts/drone-upload-exists.sh @@ -21,7 +21,7 @@ fork_repo=$(echo "$head_info" | grep -o '"full_name":"[^"]*' | sed 's/"full_name fork_branch=$(echo "$head_info" | grep -o '"ref":"[^"]*' | sed 's/"ref":"//') upload_dir="https://oxen.rocks/${fork_repo}/${fork_branch}" -echo "Starting to poll ${upload_dir} every 10s to check for a build matching '${prefix}.*${suffix}'" +echo "Starting to poll ${upload_dir}/ every 10s to check for a build matching '${prefix}.*${suffix}'" # Loop indefinitely the CI can timeout the script if it takes too long total_poll_duration=0 @@ -32,14 +32,12 @@ while true; do build_artifacts_html=$(curl -s "${upload_dir}/") if [ $? != 0 ]; then - echo "Failed to retrieve build artifact list" + echo -e "\n\n\n\n\e[31;1mFailed to retrieve build artifact list\e[0m\n\n\n" exit 1 fi - # Extract 'session-ios...' titles using grep and awk - current_build_artifacts=$(echo "$build_artifacts_html" | grep -o 'href="${prefix}[^"]*' | sed 's/href="//') - - # Use grep to check for the combination + # Extract 'session-ios...' titles using grep and awk then look for the target file + current_build_artifacts=$(echo "$build_artifacts_html" | grep -o "href=\"${prefix}[^\"]*" | sed 's/href="//') target_file=$(echo "$current_build_artifacts" | grep -o "${prefix}.*${suffix}" | tail -n 1) if [ -n "$target_file" ]; then