Skip to content

Commit

Permalink
Allow using brew installed dev version of lima.
Browse files Browse the repository at this point in the history
  • Loading branch information
terev committed Nov 14, 2023
1 parent 5c68fa0 commit 0bb00c0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/sirupsen/logrus"
"strings"

"github.com/abiosoft/colima/cli"
Expand Down Expand Up @@ -120,8 +121,18 @@ func LimaVersionSupported() error {
return fmt.Errorf("error decoding 'limactl info' json: %w", err)
}
// remove pre-release hyphen
if str := strings.SplitN(values.Version, "-", 2); len(str) > 0 {
values.Version = str[0]
parts := strings.SplitN(values.Version, "-", 2)
if len(parts) > 0 {
values.Version = parts[0]
}

if parts[0] == "HEAD" {
version := parts[0]
if len(parts) > 1 {
version = parts[1]
}
logrus.Warnf("to avoid compatibility issues, ensure lima development version (%s) in use is not lower than %s", version, limaVersion)
return nil
}

min := semver.New(strings.TrimPrefix(limaVersion, "v"))
Expand Down

0 comments on commit 0bb00c0

Please sign in to comment.