From af2ed579d23e3ec7446eb9f5c3a5ff01aae95a09 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Fri, 23 Mar 2012 21:17:31 +0100 Subject: [PATCH] fix motion support to properly locate xcode version --- bin/motion | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/motion b/bin/motion index a3dcf06e..10f29879 100644 --- a/bin/motion +++ b/bin/motion @@ -85,10 +85,18 @@ class SupportCommand < Command email = URI.escape(`git config --get user.email`.strip) # Collect details about the environment. - osx_vers = `sw_vers -productVersion`.strip + osx_vers = `/usr/bin/sw_vers -productVersion`.strip rm_vers = Motion::Version - xcode_vers = `xcodebuild -version`.strip.scan(/Xcode\s(.+)$/).flatten[0].to_s - xcode_vers = 'unknown' if xcode_vers.empty? + xcode_vers = begin + xcodebuild = `which xcodebuild`.strip + xcodebuild = '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild' if xcodebuild.empty? + vers = '' + if File.exist?(xcodebuild) + vers = `#{xcodebuild} -version`.strip.scan(/Xcode\s(.+)$/).flatten[0].to_s + end + vers = 'unknown' if vers.empty? + vers + end environment = URI.escape("OSX #{osx_vers}, RubyMotion #{rm_vers}, Xcode #{xcode_vers}")