Commit 268c3b29 authored by Nolan Waite's avatar Nolan Waite

`pod install` can take a project

parent 31a02728
...@@ -4,10 +4,11 @@ module Pod ...@@ -4,10 +4,11 @@ module Pod
def self.banner def self.banner
%{Installing dependencies of a pod spec: %{Installing dependencies of a pod spec:
$ pod install [NAME] $ pod install [NAME] [PROJECT]
Downloads all dependencies of the specified podspec file `NAME' and Downloads all dependencies of the specified podspec file `NAME',
creates an Xcode Pods library project in `./Pods'. In case `NAME' is creates an Xcode Pods library project in `./Pods', and sets up `PROJECT'
to use the specified pods (if `PROJECT' is given). In case `NAME' is
omitted it defaults to either `Podfile' or `*.podspec' in the current omitted it defaults to either `Podfile' or `*.podspec' in the current
working directory. working directory.
} }
...@@ -20,9 +21,10 @@ module Pod ...@@ -20,9 +21,10 @@ module Pod
def initialize(argv) def initialize(argv)
config.clean = !argv.option('--no-clean') config.clean = !argv.option('--no-clean')
if podspec = argv.shift_argument projpath = argv.shift_argument
@podspec = Pathname.new(podspec) projpath =~ /\.xcodeproj$/ ? @projpath = projpath : podspec = projpath
end @podspec = Pathname.new(podspec) if podspec
@projpath ||= argv.shift_argument
super unless argv.empty? super unless argv.empty?
end end
...@@ -39,7 +41,9 @@ module Pod ...@@ -39,7 +41,9 @@ module Pod
raise Informative, "No `Podfile' or `.podspec' file found in the current working directory." raise Informative, "No `Podfile' or `.podspec' file found in the current working directory."
end end
end end
Installer.new(spec).install! installer = Installer.new(spec)
installer.install!
installer.configure_project(@projpath) if @projpath
end end
end 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