Skip to content

Commit

Permalink
fix logic / success var
Browse files Browse the repository at this point in the history
  • Loading branch information
plowsof committed Oct 1, 2024
1 parent e8811ae commit f54caa2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions shared_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ git_clone_reset() {
local commit=$3
local init_submodules=$4
local qt5=$5
local success=false

# If qt5 is true, change directory to qt5 before the loop
if [ "$qt5" = true ]; then
Expand All @@ -515,23 +516,29 @@ git_clone_reset() {
fi

cd .. || return 1
return 0
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."
fi
done

echo "Failed to clone from all provided URLs."

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

return 1
# Return based on whether any cloning operation was successful
if [ "$success" = true ]; then
return 0
else
echo "Failed to clone from all provided URLs."
return 1
fi
}



dpkg_ordered() {
local -a tuplet=("$@")
for ((i = 0; i < ${#tuplet[@]}; i+=3)); do
Expand Down

0 comments on commit f54caa2

Please sign in to comment.