Skip to content

Commit

Permalink
version-compare: use print_line over echo
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Nov 2, 2023
1 parent 7cb07ab commit 0e285df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/version-compare
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ function version_compare() (
current_part="${current_parts[$current_depth]:-0}"
other_part="${other_parts[$current_depth]:-0}"
if test "$current_part" -gt "$other_part"; then
echo 1 # greater than
print_line '1' # greater than
return 0
fi
if test "$other_part" -gt "$current_part"; then
echo -1 # less than
print_line '-1' # less than
return 0
fi
done

echo 0 # equal
print_line '0' # equal
)

# fire if invoked standalone
Expand Down

0 comments on commit 0e285df

Please sign in to comment.