Permalink
Browse files

retrieve the app bundle path from the xcode environment because xcode…

…4 is too buggy to actually pass it properly

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5285 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 884806c commit 7ae86f343f6faa4962a6d6751cde03751f1033ae @lrz lrz committed Mar 23, 2011
Showing with 12 additions and 2 deletions.
  1. +12 −2 bin/ruby_deploy
View
@@ -33,8 +33,18 @@ class Deployer
rescue OptionParser::InvalidOption => e
die e, opts
end
- die opts if argv.size != 1
- @app_bundle = argv[0]
+ if argv.empty?
+ # If we are ran from Xcode, determine the application bundle from the environment.
+ build_dir = ENV['TARGET_BUILD_DIR']
+ project_name = ENV['PROJECT_NAME']
+ if build_dir and project_name
+ @app_bundle = File.join(build_dir, project_name + '.app')
+ end
+ end
+ unless @app_bundle
+ die opts if argv.size != 1
+ @app_bundle = argv[0]
+ end
end
ensure_path @app_bundle

0 comments on commit 7ae86f3

Please sign in to comment.