Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e0afef

Browse files
committed
Slight cleanup for env code.
1 parent 591ba73 commit 6e0afef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

providers/pip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def remove_package(version)
152152
def pip_cmd(subcommand, version='')
153153
options = { :timeout => new_resource.timeout, :user => new_resource.user, :group => new_resource.group }
154154
environment = Hash.new
155-
environment.merge!({ 'HOME' => ::File.expand_path("~#{new_resource.user}") }) if new_resource.user
156-
environment.merge!(new_resource.environment) if new_resource.environment
155+
environment['HOME'] = Dir.home(new_resource.user) if new_resource.user
156+
environment.merge!(new_resource.environment) if new_resource.environment && !new_resource.environment.empty?
157157
options[:environment] = environment
158158
shell_out!("#{which_pip(new_resource)} #{subcommand} #{new_resource.options} #{new_resource.package_name}#{version}", options)
159159
end

0 commit comments

Comments
 (0)