Class: SSHKit::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/california/stage.rb

Instance Method Summary collapse

Instance Method Details

#userObject

Define $HOME to be in /mnt/apps/USERNAME Add ~/bin to $PATH Source any existing .bash_profile in the home directory



68
69
70
71
72
73
74
75
# File 'lib/california/stage.rb', line 68

def user
  return yield unless options[:user]
  %(sudo -u #{options[:user]} #{environment_string} -- bash -c '\
    export HOME=/mnt/apps/#{options[:user]}; \
    export PATH="$HOME/bin:$PATH"; \
    source $HOME/.bash_profile; \
    #{yield.to_s.gsub("'", %q('"'"'))}')
end