File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,9 @@ def gem_environment
9191 h = { }
9292 if habitat_install?
9393 # Habitat-specific environment variables
94- h [ "GEM ROOT" ] = habitat_env [ "GEM_ROOT" ]
95- h [ "GEM HOME" ] = habitat_env [ "GEM_HOME" ]
96- h [ "GEM PATHS" ] = habitat_env [ "GEM_PATH" ] . split ( File ::PATH_SEPARATOR )
94+ h [ "GEM ROOT" ] = habitat_env ( show_warning : true ) [ "GEM_ROOT" ]
95+ h [ "GEM HOME" ] = habitat_env ( show_warning : true ) [ "GEM_HOME" ]
96+ h [ "GEM PATHS" ] = habitat_env ( show_warning : true ) [ "GEM_PATH" ] . split ( File ::PATH_SEPARATOR )
9797 elsif omnibus_install?
9898 # Omnibus-specific environment variables
9999 h [ "GEM ROOT" ] = omnibus_env [ "GEM_ROOT" ]
@@ -109,7 +109,7 @@ def gem_environment
109109 end
110110
111111 def paths
112- env = habitat_install? ? habitat_env : omnibus_env
112+ env = habitat_install? ? habitat_env ( show_warning : true ) : omnibus_env
113113 env [ "PATH" ] . split ( File ::PATH_SEPARATOR )
114114 rescue OmnibusInstallNotFound
115115 ENV [ "PATH" ] . split ( File ::PATH_SEPARATOR )
Original file line number Diff line number Diff line change @@ -154,15 +154,15 @@ def git_windows_bin_dir
154154 #
155155 # environment vars for habitat
156156 #
157- def habitat_env
157+ def habitat_env ( show_warning : false )
158158 @habitat_env ||=
159159 begin
160160 if habitat_chef_dke?
161161 bin_pkg_prefix = get_pkg_prefix ( ChefCLI ::Dist ::CHEF_DKE_PKG_NAME )
162162 end
163163 versioned_pkg_prefix = fetch_chef_cli_version_pkg if ENV [ "CHEF_CLI_VERSION" ]
164164
165- if ENV [ "CHEF_CLI_VERSION" ] && !versioned_pkg_prefix
165+ if show_warning && ENV [ "CHEF_CLI_VERSION" ] && !versioned_pkg_prefix
166166 ChefCLI ::UI . new . msg ( "Warning: Habitat package '#{ ChefCLI ::Dist ::HAB_PKG_NAME } ' with version '#{ ENV [ "CHEF_CLI_VERSION" ] } ' not found." )
167167 end
168168 # Use the first available package for bin_pkg_prefix
You can’t perform that action at this time.
0 commit comments