Commit ce53feaf authored by Martin Kavalar's avatar Martin Kavalar

Running `pod repo update` in `pod install` command. Closes #48.

parent 36361198
...@@ -19,11 +19,13 @@ module Pod ...@@ -19,11 +19,13 @@ module Pod
def self.options def self.options
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" + " --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" +
" --no-update Skip running `pod repo update` before install\n" +
super super
end end
def initialize(argv) def initialize(argv)
config.clean = !argv.option('--no-clean') config.clean = !argv.option('--no-clean')
@update_repo = !argv.option('--no-update')
@projpath = argv.shift_argument @projpath = argv.shift_argument
super unless argv.empty? super unless argv.empty?
end end
...@@ -35,6 +37,9 @@ module Pod ...@@ -35,6 +37,9 @@ module Pod
if @projpath && !File.exist?(@projpath) if @projpath && !File.exist?(@projpath)
raise Informative, "The specified project `#{@projpath}' does not exist." raise Informative, "The specified project `#{@projpath}' does not exist."
end end
if @update_repo
Repo.new(ARGV.new(["update"])).run
end
installer = Installer.new(podfile) installer = Installer.new(podfile)
installer.install! installer.install!
installer.configure_project(@projpath) if @projpath installer.configure_project(@projpath) if @projpath
......
...@@ -13,8 +13,7 @@ module Pod ...@@ -13,8 +13,7 @@ module Pod
def self.search(dependency) def self.search(dependency)
all.map { |s| s.search(dependency) }.compact.first || all.map { |s| s.search(dependency) }.compact.first ||
raise(Informative, "Unable to find a pod named `#{dependency.name}'.\n" \ raise(Informative, "Unable to find a pod named `#{dependency.name}'")
"You might want to run `pod repo update` and try again.")
end end
def self.search_by_name(query, full_text_search) def self.search_by_name(query, full_text_search)
......
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