Skip to content

Commit

Permalink
break loop early
Browse files Browse the repository at this point in the history
  • Loading branch information
plowsof committed Oct 2, 2024
1 parent 68c45ae commit 2a3b3a3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions shared_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ git_clone_reset() {
if [ "$qt5" = true ]; then
cd qt5 || return 1
fi

# Split the comma-separated list of git mirrors
IFS=',' read -ra repo_array <<< "$repos"

Expand All @@ -524,20 +523,17 @@ git_clone_reset() {
git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4
git -C m4 reset --hard c617eee22ae5c285e79e81ec39ce96862fd3262f
fi

cd .. || return 1
success=true
# Do not return here; continue to the next repo if multiple are given
else
echo "Failed to clone $repo, trying next URL if available."
# Exit immedietely after successful clone
break
fi
done

# If qt5 is true, change directory back after the loop
if [ "$qt5" = true ]; then
cd .. || return 1
fi

# Return based on whether any cloning operation was successful
if [ "$success" = true ]; then
return 0
Expand Down

0 comments on commit 2a3b3a3

Please sign in to comment.