Merge pull request #3673 from rickard-von-essen/prl-support-future-ver
Support future versions of Parallels by using the latest driver
This commit is contained in:
commit
cd0620d1f8
|
@ -5,6 +5,7 @@ import (
|
|||
"log"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -125,6 +126,14 @@ func NewDriver() (Driver, error) {
|
|||
supportedVersions = append(supportedVersions, v)
|
||||
}
|
||||
|
||||
latestDriver := 11
|
||||
version, _ := drivers[strconv.Itoa(latestDriver)].Version()
|
||||
majVer, _ := strconv.Atoi(strings.SplitN(version, ".", 2)[0])
|
||||
if majVer > latestDriver {
|
||||
log.Printf("Your version of Parallels Desktop for Mac is %s, Packer will use driver for version %d.", version, latestDriver)
|
||||
return drivers[strconv.Itoa(latestDriver)], nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf(
|
||||
"Unable to initialize any driver. Supported Parallels Desktop versions: "+
|
||||
"%s\n", strings.Join(supportedVersions, ", "))
|
||||
|
|
Loading…
Reference in New Issue