Skip to content

Commit

Permalink
[gym] fix in the gym/runner. When moving mac 'app' silently fails if …
Browse files Browse the repository at this point in the history
…file already exist in that location. (#18529)

* Fix in the gym/runner. When moving mac 'app' file silently fails if app already exists in the given location.

* Linter - Autocorrection
  • Loading branch information
krzysiek84 committed Apr 14, 2021
1 parent bc4a564 commit e5c127f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gym/lib/gym/runner.rb
Expand Up @@ -243,8 +243,12 @@ def move_ipa
# Moves over the binary and dsym file to the output directory
# @return (String) The path to the resulting pkg file
def move_pkg
FileUtils.mv(PackageCommandGenerator.binary_path, File.expand_path(Gym.config[:output_directory]), force: true)
binary_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.binary_path)))
if File.exist?(binary_path)
UI.important(" Removing #{File.basename(binary_path)}") if FastlaneCore::Globals.verbose?
FileUtils.rm_rf(binary_path)
end
FileUtils.mv(PackageCommandGenerator.binary_path, File.expand_path(Gym.config[:output_directory]), force: true)

UI.success("Successfully exported and signed the pkg file:")
UI.message(binary_path)
Expand Down

0 comments on commit e5c127f

Please sign in to comment.