Skip to content

Commit f3aa1dc

Browse files
committed
Make missing fonts interrupt the lane with user_error!
1 parent 0ea9658 commit f3aa1dc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def self.run(params)
1313

1414
config = helper.read_config(params[:config_file])
1515

16-
helper.check_fonts_installed(config: config) unless params[:skip_font_check]
16+
helper.check_fonts_installed!(config: config) unless params[:skip_font_check]
1717

1818
translationDirectories = subdirectories_for_path(params[:metadata_folder])
1919
imageDirectories = subdirectories_for_path(params[:orig_folder])

lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def read_config(configFilePath)
5252
# - Finally, for each of those fonts, check that they exist and are activated.
5353
#
5454
# @param [Hash] config The promo screenshots configuration, as returned by #read_config
55-
# @return [Boolean] True if all necessary fonts are installed, false if at least one font is missing.
55+
# @raise [UserError] Raises if at least one font is missing.
5656
#
57-
def check_fonts_installed(config:)
57+
def check_fonts_installed!(config:)
5858
# Find all stylesheets in the config
5959
all_stylesheets = ([config['stylesheet']] + config['entries'].flat_map do |entry|
6060
entry['attachments']&.map { |att| att['stylesheet'] }
@@ -90,7 +90,7 @@ def check_fonts_installed(config:)
9090
f.close
9191
oe, s = Open3.capture2e('/usr/bin/env', 'xcrun', 'swift', f.path, *font_families)
9292
UI.command_output(oe)
93-
s.success?
93+
UI.user_error!('Some fonts required by your stylesheets are missing. Please install them and try again.') unless s.success?
9494
end
9595
end
9696

0 commit comments

Comments
 (0)