Skip to content

Commit

Permalink
Include the full path name in file not found error message. fastlane#…
Browse files Browse the repository at this point in the history
…5962 (fastlane#5979)

* Include the full path name in file not found error message.

* Update test to look for full file path when checking file not found.
  • Loading branch information
frisocki authored and KrauseFx committed Sep 2, 2016
1 parent edddab3 commit 222600b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fastlane/lib/fastlane/actions/update_info_plist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.run(params)

# Read existing plist file
info_plist_path = File.join(folder, "..", params[:plist_path])
UI.user_error!("Couldn't find info plist file at path '#{params[:plist_path]}'") unless File.exist?(info_plist_path)
UI.user_error!("Couldn't find info plist file at path '#{info_plist_path}'") unless File.exist?(info_plist_path)
plist = Xcodeproj::Plist.read_from_path(info_plist_path)

# Update plist values
Expand Down
5 changes: 4 additions & 1 deletion fastlane/spec/actions_specs/update_info_plist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
end

it "throws an error when the info plist file does not exist" do
# This is path update_info_plist creates to locate the plist file.
full_path = [test_path, proj_file, '..', "NOEXIST-#{plist_path}"].join(File::SEPARATOR)

expect do
Fastlane::FastFile.new.parse("lane :test do
update_info_plist ({
Expand All @@ -72,7 +75,7 @@
display_name: '#{display_name}'
})
end").runner.execute(:test)
end.to raise_error("Couldn't find info plist file at path 'NOEXIST-#{plist_path}'")
end.to raise_error("Couldn't find info plist file at path '#{full_path}'")
end

it "throws an error when the scheme does not exist" do
Expand Down

0 comments on commit 222600b

Please sign in to comment.