mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Merge branch 'fix-cli' into 'master'
need to use >=17.05 (not 17.5), add trimming for weird builds See merge request !43
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/coreos/go-semver/semver"
|
||||
|
||||
@@ -130,7 +131,10 @@ func dockerVersionCheck() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not check Docker version: %v", err)
|
||||
}
|
||||
v, err := semver.NewVersion(string(out))
|
||||
// dev / test builds append '-ce', trim this
|
||||
trimmed := strings.TrimRightFunc(string(out), func(r rune) bool { return r != '.' && !unicode.IsDigit(r) })
|
||||
|
||||
v, err := semver.NewVersion(trimmed)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not check Docker version: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user