Skip to content

Commit

Permalink
Avoid loading and showing the Snapfile loading twice (#7497)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed Dec 17, 2016
1 parent 6ec59d6 commit 8b4565c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion snapshot/lib/snapshot/detect_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def self.set_additional_default_values
config = Snapshot.config

# First, try loading the Snapfile from the current directory
configuration_file_path = File.expand_path(Snapshot.snapfile_name)
config.load_configuration_file(Snapshot.snapfile_name)

# Detect the project
Expand All @@ -13,7 +14,9 @@ def self.set_additional_default_values

# Go into the project's folder, as there might be a Snapfile there
Dir.chdir(File.expand_path("..", Snapshot.project.path)) do
config.load_configuration_file(Snapshot.snapfile_name)
unless File.expand_path(Snapshot.snapfile_name) == configuration_file_path
config.load_configuration_file(Snapshot.snapfile_name)
end
end

Snapshot.project.select_scheme(preferred_to_include: "UITests")
Expand Down

0 comments on commit 8b4565c

Please sign in to comment.