-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
This is my bubble sort funtion
declare -a VERSION=( ... )
BUBBLE="1"
while [ "$BUBBLE" == 1 ]; do
BUBBLE="0"
for I in $(seq 0 "$((${#VERSIONS[@]} - 1))"); do
# Skip first element
[ "$I" == 0 ] && continue
PREVIOUS="$((I - 1))"
if semverGT "${VERSIONS[$PREVIOUS]}" "${VERSIONS[$I]}"; then
BUBBLE="1"
BUFFER="${VERSIONS[$I]}"
VERSIONS[$I]="${VERSIONS[$PREVIOUS]}"
VERSIONS[$PREVIOUS]="$BUFFER"
fi
done
doneMetadata
Metadata
Assignees
Labels
No labels