Skip to content

Commit

Permalink
Don't assume scheme for the derived data folder.
Browse files Browse the repository at this point in the history
Correct an issue where the first derived path found contains a file, leading to a double forward slash in the calculated path.
Raise an ArgumentError if the configuration is missing target AND app_name, which would lead to a bad path.
  • Loading branch information
subdigital committed Jul 27, 2011
1 parent 936d9b0 commit b8730fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/beta_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def archive_name
end

def app_file_name
raise ArgumentError, "app_name or target must be set in the BetaBuilder configuration block" if app_name.nil? && target.nil?
if app_name
"#{app_name}.app"
else
Expand Down Expand Up @@ -75,8 +76,8 @@ def derived_build_dir_from_build_output
output = File.read("build.output")

# yes, this is truly horrible, but unless somebody else can find a better way...
reference = output.split("\n").grep(/Xcode\/DerivedData\/#{scheme}-(.*)/).first.split(" ").last
derived_data_directory = reference.split("/Build/Products").first
reference = output.split("\n").grep(/Xcode\/DerivedData\/(.*)-(.*)/).first.split(" ").last
derived_data_directory = reference.split("/Build/Products/").first
"#{derived_data_directory}/Build/Products/"
end

Expand Down

0 comments on commit b8730fc

Please sign in to comment.