Skip to content

Commit

Permalink
pod install can take a project
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanw committed Oct 23, 2011
1 parent 31a0272 commit 268c3b2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/cocoapods/command/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ class Install < Command
def self.banner
%{Installing dependencies of a pod spec:
$ pod install [NAME]
$ pod install [NAME] [PROJECT]
Downloads all dependencies of the specified podspec file `NAME' and
creates an Xcode Pods library project in `./Pods'. In case `NAME' is
Downloads all dependencies of the specified podspec file `NAME',
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
working directory.
}
Expand All @@ -20,9 +21,10 @@ def self.options

def initialize(argv)
config.clean = !argv.option('--no-clean')
if podspec = argv.shift_argument
@podspec = Pathname.new(podspec)
end
projpath = argv.shift_argument
projpath =~ /\.xcodeproj$/ ? @projpath = projpath : podspec = projpath
@podspec = Pathname.new(podspec) if podspec
@projpath ||= argv.shift_argument
super unless argv.empty?
end

Expand All @@ -39,7 +41,9 @@ def run
raise Informative, "No `Podfile' or `.podspec' file found in the current working directory."
end
end
Installer.new(spec).install!
installer = Installer.new(spec)
installer.install!
installer.configure_project(@projpath) if @projpath
end
end
end
Expand Down

0 comments on commit 268c3b2

Please sign in to comment.