mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Add Mac compatibility to boulder-start
The version of sort that ships with OS X does not support the -V version flag. Emulate that functionality with some sed-fu
This commit is contained in:
parent
5cc9061413
commit
cbfdae88fc
1 changed files with 6 additions and 1 deletions
|
|
@ -4,11 +4,16 @@
|
|||
|
||||
# ugh, go version output is like:
|
||||
# go version go1.4.2 linux/amd64
|
||||
GOVER=`go version | cut -d" " -f3 | cut -do -f2`
|
||||
GOVER=`go version | cut -d" " -f3 | cut -do -f2`
|
||||
|
||||
# version comparison
|
||||
function verlte {
|
||||
if [ `uname` == 'Darwin' ]; then
|
||||
[ "$1" = "`echo -e \"$1\n$2\" | sed 's/\b\([0-9]\)\b/0\1/g' \
|
||||
| sort | sed 's/\b0\([0-9]\)/\1/g' | head -n1`" ]
|
||||
else
|
||||
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
|
||||
fi
|
||||
}
|
||||
|
||||
if ! verlte 1.5 "$GOVER" ; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue