Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the default target for `platform :osx` the current system's version

This change makes the default target when the platform is `:osx` the
system's version of OS X if it can be found by querying the
system. Otherwise the default '10.6' is used. Setting the target in
the podfile still overrides the default target.
  • Loading branch information...
commit dec9d1ce408f7cc28c62ffa1acd2a702e33bcc33 1 parent fe96a97
@croach authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/cocoapods/podfile.rb
View
8 lib/cocoapods/podfile.rb
@@ -223,7 +223,13 @@ def platform(name, target = nil)
when :ios
target = '4.3'
when :osx
- target = '10.6'
+ # Get the current version of OS X if we can, otherwise default to 10.6
+ begin
+ os_version = `sw_vers -productVersion`.chomp
+ target = os_version.split('.')[0, 2].join('.')
+ rescue
+ target = '10.6'
+ end
else
raise ::Pod::Podfile::Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
end
Please sign in to comment.
Something went wrong with that request. Please try again.