summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-04-01 08:51:57 -0700
committerGitHub <noreply@github.com>2020-04-01 08:51:57 -0700
commit811e31ba79d08ac9443f0806c5099b9d6488a131 (patch)
tree6b7db235802d31f09f0ce0d4267507c8a5516f44
parentc73fff159a28ea4df17ce76526a04733476bd88a (diff)
parentc04f686c50ac33491b039cdc5bc2f1992ef83738 (diff)
downloadchef-811e31ba79d08ac9443f0806c5099b9d6488a131.tar.gz
Merge pull request #9565 from TheLunaticScripter/tls/hab_version_fix
Make the hab version check a full version check not just minor release
-rw-r--r--habitat/plan.ps15
1 files changed, 2 insertions, 3 deletions
diff --git a/habitat/plan.ps1 b/habitat/plan.ps1
index e15f076ba3..719f5e7a5a 100644
--- a/habitat/plan.ps1
+++ b/habitat/plan.ps1
@@ -16,9 +16,8 @@ $pkg_deps=@(
)
function Invoke-Begin {
- $hab_version = (hab --version)
- $hab_minor_version = $hab_version.split('.')[1]
- if ( -not $? -Or $hab_minor_version -lt 85 ) {
+ [Version]$hab_version = (hab --version).split(" ")[1].split("/")[0]
+ if ($hab_version -lt [Version]"0.85.0" ) {
Write-Warning "(╯°□°)╯︵ ┻━┻ I CAN'T WORK UNDER THESE CONDITIONS!"
Write-Warning ":habicat: I'm being built with $hab_version. I need at least Hab 0.85.0, because I use the -IsPath option for setting/pushing paths in SetupEnvironment."
throw "unable to build: required minimum version of Habitat not installed"