summaryrefslogtreecommitdiff
path: root/habitat
diff options
context:
space:
mode:
authorJohn Snow <thelunaticscripter@outlook.com>2020-04-01 07:19:33 -0400
committerJohn Snow <thelunaticscripter@outlook.com>2020-04-01 07:19:33 -0400
commit2943c093e24027c618f3408e51ad37dc83c3885b (patch)
tree0f20ed747bffa8f4a32a867b760cc211744ab42b /habitat
parent4a1814e08abb240a8f5ab029b793d80ae2613fda (diff)
downloadchef-2943c093e24027c618f3408e51ad37dc83c3885b.tar.gz
Make the hab version check a full version check not just minor release
Signed-off-by: John Snow <thelunaticscripter@outlook.com>
Diffstat (limited to 'habitat')
-rw-r--r--habitat/plan.ps16
1 files changed, 3 insertions, 3 deletions
diff --git a/habitat/plan.ps1 b/habitat/plan.ps1
index e15f076ba3..5b26071f2b 100644
--- a/habitat/plan.ps1
+++ b/habitat/plan.ps1
@@ -16,9 +16,9 @@ $pkg_deps=@(
)
function Invoke-Begin {
- $hab_version = (hab --version)
- $hab_minor_version = $hab_version.split('.')[1]
- if ( -not $? -Or $hab_minor_version -lt 85 ) {
+ $hab_version = (hab --version).split(" ")
+ [Version]$hab_version = $hab_version[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"