From 25813b641a114dd9264d50dfa49ad4a7ec656040 Mon Sep 17 00:00:00 2001 From: Niket Shah Date: Thu, 29 Oct 2015 09:33:23 +0000 Subject: [PATCH] Fix for issue #115, 'Generated archive is invalid' --- lib/gym/generators/build_command_generator.rb | 3 +++ lib/gym/runner.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/gym/generators/build_command_generator.rb b/lib/gym/generators/build_command_generator.rb index 82f1c88..c0794c9 100644 --- a/lib/gym/generators/build_command_generator.rb +++ b/lib/gym/generators/build_command_generator.rb @@ -86,6 +86,9 @@ def archive_path file_name = [Gym.config[:output_name], Time.now.strftime("%F %H.%M.%S")] # e.g. 2015-08-07 14.49.12 Gym.cache[:archive_path] = File.join(build_path, file_name.join(" ") + ".xcarchive") end + if File.extname(Gym.cache[:archive_path]) != ".xcarchive" + Gym.cache[:archive_path] += ".xcarchive" + end return Gym.cache[:archive_path] end end diff --git a/lib/gym/runner.rb b/lib/gym/runner.rb index d466101..fdefe8f 100644 --- a/lib/gym/runner.rb +++ b/lib/gym/runner.rb @@ -87,7 +87,7 @@ def build_app # Makes sure the archive is there and valid def verify_archive # from https://github.com/fastlane/gym/issues/115 - if (Dir[BuildCommandGenerator.archive_path + "/*"] + Dir[BuildCommandGenerator.archive_path + ".xcarchive/*"]).count == 0 + if (Dir[BuildCommandGenerator.archive_path + "/*"]).count == 0 ErrorHandler.handle_empty_archive end end