class SSHKit::Command

Public Instance Methods

user() { || ... } click to toggle source

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

# 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