Permalink
Browse files

Set $HOME when running hooks

  • Loading branch information...
1 parent 8998715 commit b3feacf449b165b64e4f78dd2bbe8491c56951e4 @smerritt smerritt committed Mar 16, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/chef-deploy/cached_deploy.rb
@@ -157,7 +157,12 @@ def chef_run(cmd)
end
def run(cmd)
- Chef::Mixin::Command.run_command(:command => cmd, :user => user)
+ user_homedir = Etc.getpwnam(user).dir
+ Chef::Mixin::Command.run_command(
+ :command => cmd,
+ :user => user,
+ :environment => {"HOME" => user_homedir}
+ )
end
def sudo(cmd)

0 comments on commit b3feacf

Please sign in to comment.