Skip to content

Commit

Permalink
Change default git path
Browse files Browse the repository at this point in the history
  • Loading branch information
rivera-ernesto committed Mar 30, 2015
1 parent 6564b7f commit 1162f31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xcode-git-cfbundleversion.rb
Expand Up @@ -11,7 +11,7 @@
raise "Must be run from Xcode's Run Script Build Phase" unless ENV['XCODE_VERSION_ACTUAL']

# Get the current git revision hash
revision = `/opt/local/bin/git rev-parse --short HEAD`.chomp!
revision = `/usr/bin/git rev-parse --short HEAD`.chomp!

# Update Info.plist file
plistFile = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH'])
Expand All @@ -22,7 +22,7 @@
# Open Info.plist and set the CFBundleVersion value to the revision hash
lines = IO.readlines(plistFile).join
lines.gsub! /(<key>CFBundleVersion<\/key>\n\t<string>).*?(<\/string>)/, "\\1#{ENV['CURRENT_PROJECT_VERSION']}-#{revision}\\2"

# Overwrite the original Info.plist file with our updated version
File.open(plistFile, 'w') {|f| f.puts lines}

Expand All @@ -31,4 +31,3 @@

# Report to the user
puts "CFBundleVersion in #{plistFile} sets to '#{revision}'"

0 comments on commit 1162f31

Please sign in to comment.