Skip to content

Commit 779371b

Browse files
committed
fix: checking version was too strict
check_version now doesn't fail when `tool` has version `0.X` and `threshold` is set to `0.X.0`
1 parent 55ea798 commit 779371b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gh-notify

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,10 @@ check_version() {
627627
IFS='.' read -ra threshold_parts <<<"$threshold"
628628

629629
for i in "${!threshold_parts[@]}"; do
630+
# If the threshold's last part is 0 and version has one less parts, it's ok
631+
if (( i == ${#threshold_parts[@]} - 1 )) && ((${#ver_parts[@]} == ${#threshold_parts[@]} - 1)) && ((${threshold_parts[i]} == 0)); then
632+
break
633+
fi
630634
if ((i >= ${#ver_parts[@]})) || ((ver_parts[i] < threshold_parts[i])); then
631635
$on_error "Your '$tool' version '$user_version' is insufficient. The minimum required version is '$threshold'."
632636
elif ((ver_parts[i] > threshold_parts[i])); then

0 commit comments

Comments
 (0)