mirror of https://github.com/dyne/zuper.git
added small function to compare semantic versions
uses sort and head as external deps
This commit is contained in:
parent
4fed4af700
commit
f2785eca10
6
zuper
6
zuper
|
|
@ -531,6 +531,12 @@ s/ /%09/g
|
|||
'
|
||||
}
|
||||
|
||||
# Check if a version number (semantic format) is greater than the other
|
||||
# returns 0 if the first argument is greater or equal than the second.
|
||||
function string.version_greatoreq version_greatoreq() {
|
||||
[[ "$(printf '%s\n' "$@" | sort -rV | head -n 1)" = "$1" ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
# }}} Strings
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue