Commit aa887ea0 authored by Fabio Pelosin's avatar Fabio Pelosin

[Command] Output cosmetics.

parent a30fcb67
......@@ -114,6 +114,24 @@ module Pod
def initialize(argv)
raise Help.new(self.class, argv)
end
private
def print_title(title, only_verbose = true)
if config.verbose?
puts "\n" + title.yellow
elsif !config.silent? && !only_verbose
puts title
end
end
def print_subtitle(title, only_verbose = false)
if config.verbose?
puts "\n" + title.green
elsif !config.silent? && !only_verbose
puts title
end
end
end
end
......@@ -46,7 +46,7 @@ module Pod
end
if @update_repo
puts "\nUpdating Spec Repositories\n".yellow if config.verbose?
print_title 'Updating Spec Repositories', true
Repo.new(ARGV.new(["update"])).run
end
......
......@@ -43,7 +43,7 @@ module Pod
end
def add
puts "Cloning spec repo `#{@name}' from `#{@url}'" unless config.silent?
print_subtitle "Cloning spec repo `#{@name}' from `#{@url}'#{" (branch `#{@branch}')" if @branch}"
config.repos_dir.mkpath
Dir.chdir(config.repos_dir) { git("clone '#{@url}' #{@name}") }
Dir.chdir(dir) { git("checkout #{@branch}") } if @branch
......@@ -53,7 +53,7 @@ module Pod
def update
dirs = @name ? [dir] : config.repos_dir.children.select {|c| c.directory?}
dirs.each do |dir|
puts "Updating spec repo `#{dir.basename}'" unless config.silent?
print_subtitle "Updating spec repo `#{dir.basename}'"
Dir.chdir(dir) { git("pull") }
check_versions(dir)
end
......
......@@ -2,7 +2,7 @@ module Pod
class Command
class Setup < Command
def self.banner
%{Setup CocoaPods environment:
%{Setup CocoaPods environment:
$ pod setup
......@@ -55,7 +55,7 @@ module Pod
end
def push?
@push_option || (dir.exist? && origin_url_push?)
@push_option || (dir.exist? && origin_url_push?)
end
def read_master_repo_url
......@@ -90,6 +90,7 @@ module Pod
end
def run
print_title "Setting up CocoaPods master repo"
if dir.exist?
set_master_repo_url
set_master_repo_branch
......@@ -103,7 +104,7 @@ module Pod
hook.open('w') { |f| f << "#!/bin/sh\nrake lint" }
`chmod +x '#{hook}'`
end
puts "\nSetup completed (#{push? ? "push" : "read-only"} access)" unless config.silent
print_subtitle "Setup completed (#{push? ? "push" : "read-only"} access)"
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment