Commit 98d0fb0c authored by Fabio Pelosin's avatar Fabio Pelosin

Fine tuning console output.

parent cac18c84
......@@ -13,7 +13,7 @@ module Pod
def download
prepare_cache
puts '->'.green << ' Cloning git repo' if config.verbose?
puts '-> Cloning git repo' if config.verbose?
if options[:tag]
download_tag
elsif options[:commit]
......@@ -26,7 +26,7 @@ module Pod
def prepare_cache
unless cache_exist?
puts '->'.green << " Creating cache git repo (#{cache_path})" if config.verbose?
puts "-> Creating cache git repo (#{cache_path})" if config.verbose?
cache_path.rmtree if cache_path.exist?
cache_path.mkpath
git "clone '#{url}' #{cache_path}"
......@@ -71,7 +71,7 @@ module Pod
end
def update_cache
puts '->'.green << " Updating cache git repo (#{cache_path})" if config.verbose?
puts "-> Updating cache git repo (#{cache_path})" if config.verbose?
Dir.chdir(cache_path) do
git "reset --hard HEAD"
git "clean -d -x -f"
......
......@@ -7,8 +7,14 @@ module Pod
raise Informative, "Unable to locate the executable `#{name}'"
end
if Config.instance.verbose?
puts "-> [#{Dir.pwd}] $ #{bin} #{command}"
`#{bin} #{command} 1>&2`
print " $ #{name} #{command.length > 20 ? command[0..20] + '...' : command}\r"
$stdout.flush
output = `#{bin} #{command} 2>&1`
puts " #{$?.exitstatus.zero? ? '-' : '!'.red} #{name} #{command}"
output = output.gsub(/^ */,' ')
puts output unless output.strip.empty?
else
`#{bin} #{command} 2> /dev/null`
end
......
......@@ -48,18 +48,17 @@ module Pod
pods.each do |pod|
unless config.silent?
marker = config.verbose ? "\n-> ".green : ''
name = pod.top_specification.preferred_dependency ? "#{pod.top_specification.name}/#{pod.top_specification.preferred_dependency} (#{pod.top_specification.version})" : pod.name
name = pod.top_specification.preferred_dependency ? "#{pod.top_specification.name}/#{pod.top_specification.preferred_dependency} (#{pod.top_specification.version})" : pod.to_s
puts marker << ( pod.exists? ? "Using #{name}" : "Installing #{name}".green )
end
should_install = !pod.exists?
if should_install
unless pod.exists?
downloader = Downloader.for_pod(pod)
downloader.download
end
# The docs need to be generated before cleaning
generate_docs(pod)
pod.clean if config.clean && should_install
pod.clean if config.clean
end
end
end
......@@ -67,12 +66,11 @@ module Pod
def generate_docs(pod)
doc_generator = Generator::Documentation.new(pod)
if ( config.generate_docs? && !doc_generator.already_installed? ) || config.force_doc?
message = "Installing documentation"
puts "-> Installing documentation" if config.verbose?
doc_generator.generate(config.doc_install?)
else
message = "Using existing documentation"
puts "-> Using existing documentation"
end
puts "-> ".green << message << " for #{pod.name} (#{pod.top_specification.version})" if config.verbose?
end
def install!
......@@ -93,11 +91,11 @@ module Pod
generate_lock_file!(specifications)
generate_dummy_source
puts "* Running post install hooks" if config.verbose?
puts "- Running post install hooks" if config.verbose?
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
run_post_install_hooks
puts "* Writing Xcode project file to `#{@sandbox.project_path}'\n\n" if config.verbose?
puts "- Writing Xcode project file to `#{@sandbox.project_path}'\n\n" if config.verbose?
project.save_as(@sandbox.project_path)
UserProjectIntegrator.new(@podfile).integrate! if config.integrate_targets?
......
......@@ -92,15 +92,15 @@ module Pod
def create_files(pods, sandbox)
if @podfile.generate_bridge_support?
bridge_support_metadata_path = sandbox.root + @target_definition.bridge_support_name
puts "* Generating BridgeSupport metadata file at `#{bridge_support_metadata_path}'" if config.verbose?
puts "- Generating BridgeSupport metadata file at `#{bridge_support_metadata_path}'" if config.verbose?
bridge_support_generator_for(pods, sandbox).save_as(bridge_support_metadata_path)
copy_resources_script_for(pods).resources << @target_definition.bridge_support_name
end
puts "* Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose?
puts "- Generating xcconfig file at `#{sandbox.root + @target_definition.xcconfig_name}'" if config.verbose?
xcconfig.save_as(sandbox.root + @target_definition.xcconfig_name)
puts "* Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose?
puts "- Generating prefix header at `#{sandbox.root + @target_definition.prefix_header_name}'" if config.verbose?
save_prefix_header_as(sandbox.root + @target_definition.prefix_header_name, pods)
puts "* Generating copy resources script at `#{sandbox.root + @target_definition.copy_resources_script_name}'" if config.verbose?
puts "- Generating copy resources script at `#{sandbox.root + @target_definition.copy_resources_script_name}'" if config.verbose?
copy_resources_script_for(pods).save_as(sandbox.root + @target_definition.copy_resources_script_name)
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