Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
brainopia committed Dec 12, 2010
1 parent f89a45a commit 9f4566c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions lib/gitpusshuten/commands/user.rb
Expand Up @@ -13,12 +13,12 @@ class User < GitPusshuTen::Commands::Base

def initialize(*objects)
super

@command = cli.arguments.shift

help if command.nil? or e.name.nil?
end

##
# Sets up a new UNIX user and configures it based on the .gitpusshuten/config.rb
def perform_add!
Expand All @@ -43,25 +43,25 @@ def perform_add!
standard "\n\s\s#{(y("heavenly user reconfigure for #{e.name}"))}"
exit
end

##
# Install Git if it isn't installed yet
Spinner.return :message => "Ensuring #{y('Git')} is installed.." do
ensure_git_installed!
g('Done!')
end

##
# Install common application dependencies like xmllib and imagemagick
Spinner.return :message => "Ensuring #{y('common applictation dependencies')} are installed.." do
Spinner.return :message => "Ensuring #{y('common application dependencies')} are installed.." do
ensure_common_dependencies_are_installed!
g('Done!')
end

##
# Configures the user
configure_user!

##
# Finished adding user!
message "Finished adding and configuring #{y(c.user)}!"
Expand Down Expand Up @@ -112,7 +112,7 @@ def perform_login!
error "Cannot login, #{y(c.user)} does not exist."
exit
end

puts "ssh #{c.user}@#{c.ip} -p #{c.port}"
end

Expand All @@ -130,7 +130,7 @@ def perform_install_ssh_key!
error "To create one, run: #{y('ssh-keygen -t rsa')}"
exit
end

unless e.ssh_key_installed? # prompts root
Spinner.return :message => "Installing #{"SSH Key".color(:yellow)}.." do
e.install_ssh_key!
Expand All @@ -149,7 +149,7 @@ def perform_install_root_ssh_key!
error "To create one, run: #{y('ssh-keygen -t rsa')}"
exit
end

unless e.root_ssh_key_installed? # prompts root
Spinner.return :message => "Installing #{"SSH Key".color(:yellow)}.." do
e.install_root_ssh_key!
Expand Down Expand Up @@ -177,21 +177,21 @@ def ensure_common_dependencies_are_installed!
# Configures the user. Overwrites all current configurations (if any exist)
def configure_user!
message "Configuring #{y(c.user)}."

##
# If the user has an SSH key and it hasn't been installed
# on the server under the current user then it'll go ahead and install it
if e.has_ssh_key? and not e.ssh_key_installed?
perform_install_ssh_key!
end

##
# Configure .bashrc
Spinner.return :message => "Configuring #{y('.bashrc')}.." do
e.execute_as_root("echo -e \"export RAILS_ENV=production\nsource /etc/profile\" > '#{File.join(c.path, '.bashrc')}'")
g('Done!')
end

##
# Creating .gemrc
Spinner.return :message => "Configuring #{y('.gemrc')}.." do
Expand All @@ -200,7 +200,7 @@ def configure_user!
e.clean_up_packages!(e.home_dir)
g('Done!')
end

##
# Add user to sudoers file if not already in sudo'ers
if not e.user_in_sudoers?
Expand All @@ -209,7 +209,7 @@ def configure_user!
g('Done!')
end
end

##
# Checks to see if the RVM group exists.
# If it does exist, perform RVM specific tasks.
Expand All @@ -227,7 +227,7 @@ def configure_user!
g('Done!')
end
end

##
# Installs the .gitconfig and minimum configuration
# if the configuration file does not exist.
Expand All @@ -236,14 +236,14 @@ def configure_user!
e.install_pushand!
g('Done!')
end

##
# Ensure home directory ownership is set to the user
Spinner.return :message => "Setting permissions.." do
e.execute_as_root("chown -R #{c.user}:#{c.user} '#{e.home_dir}'")
g('Done!')
end

message "Finished configuring #{y(c.user)}."
end

Expand Down

0 comments on commit 9f4566c

Please sign in to comment.