From 9c9606584d89ef164d2a1b0aa5024b0220aadad0 Mon Sep 17 00:00:00 2001 From: Sachin Date: Thu, 28 Nov 2024 17:25:48 +0530 Subject: [PATCH] Pick version from Version file instead of Hardcoded Signed-off-by: Sachin --- habitat/plan.ps1 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 2fbe1836..e5b8a85b 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -3,8 +3,7 @@ $PSDefaultParameterValues['*:ErrorAction']='Stop' $pkg_name="fauxhai" $pkg_origin="core" -$pkg_version="9.3.16" -$pkg_revision="1" +$pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION") $pkg_maintainer="The Chef Maintainers " $pkg_deps=@( @@ -15,6 +14,19 @@ $pkg_bin_dirs=@("bin" "vendor/bin") $project_root= (Resolve-Path "$PLAN_CONTEXT/../").Path +function pkg_version { + Get-Content "$SRC_PATH/VERSION" +} + +function Invoke-Before { + Set-PkgVersion +} + +# Invoke-Before hook to set package version early +function Invoke-Before { + Set-PkgVersion +} + function Invoke-SetupEnvironment { Push-RuntimeEnv -IsPath GEM_PATH "$pkg_prefix/vendor"