Commit d0344d84 authored by Fabio Pelosin's avatar Fabio Pelosin

[Command] Fix issue that lead to ignoring the --verbose option.

parent 69daa1dc
......@@ -24,7 +24,7 @@ module Pod
def self.parse(argv)
command = super
unless command.is_a?(Setup) || ENV['SKIP_SETUP']
Setup.new(CLAide::ARGV.new([])).run_if_needed
Setup.run_if_needed
end
command
end
......@@ -48,10 +48,13 @@ module Pod
end
end
# @todo If a command is run inside another one some settings which where
# true might return false.
#
def initialize(argv)
config.silent = argv.flag?('silent')
config.silent ||= argv.flag?('silent')
super
config.verbose = self.verbose?
config.verbose ||= self.verbose?
# TODO we should probably not even load colored unless needed
String.send(:define_method, :colorize) { |string , _| string } unless self.colorize_output?
end
......
......@@ -24,8 +24,12 @@ module Pod
super
end
def self.dir
Config.instance.repos_dir + 'master'
end
def dir
config.repos_dir + 'master'
self.class.dir
end
def read_only_url
......@@ -82,8 +86,9 @@ module Pod
end
end
def run_if_needed
run unless dir.exist? && Repo.compatible?('master')
def self.run_if_needed
self.new(CLAide::ARGV.new([])).run unless
dir.exist? && Repo.compatible?('master')
end
def run
......
......@@ -49,7 +49,7 @@ describe Pod::Command::Setup do
output = run_command('setup')
output.should.include "Setup completed"
Pod::UI.output = ''
command('setup').run_if_needed
Pod::Command::Setup.run_if_needed
Pod::UI.output.should == ''
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