Skip to content

Commit c03b18d

Browse files
committed
Do not report "file not found" during validation if we had (and already reported) a download failure (e.g. 404)
1 parent 41225bf commit c03b18d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def self.run(params)
2424

2525
# Validate that a `.strings` file downloaded from GlotPress seems valid and does not contain empty translations
2626
def self.validate_strings_file(destination)
27-
translations = Fastlane::Helper::Ios::L10nHelper.read_strings_file_as_hash(destination)
27+
return unless File.exist?(destination) # If the file failed to download, don't try to validate an non-existing file. We'd already have a separate error for the download failure anyway.
28+
29+
translations = Fastlane::Helper::Ios::L10nHelper.read_strings_file_as_hash(path: destination)
2830
empty_keys = translations.select { |_, value| value.nil? || value.empty? }.keys
2931
unless empty_keys.empty?
3032
UI.error(

0 commit comments

Comments
 (0)