From 3c4eea848775164257d13d37d16176798023dc02 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 15 Jan 2026 20:18:18 +1100 Subject: [PATCH 1/4] Silence the check for `drawText` in the path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, every hit (and there are many) of the method would print the path in the logs. Example: ``` [20:09:25]: ------------------------------- [20:09:25]: --- Step: promo_screenshots --- [20:09:25]: ------------------------------- [20:09:25]: Creating Promo Screenshots /opt/homebrew/bin/drawText [20:09:25]: ✅ Original Screenshot Source: /Users/gio/Developer/a8c/wcios/fastlane/screenshots /opt/homebrew/bin/drawText [20:09:25]: ✅ Translation source: /Users/gio/Developer/a8c/wcios/fastlane/metadata /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText [20:09:26]: ▸ ✅ Font "Helvetica Neue" found and active /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText [20:09:26]: ✅ Output Folder: /Users/gio/Developer/a8c/wcios/fastlane/promo_screenshots /opt/homebrew/bin/drawText [20:09:26]: 💙 Creating Promo Screenshots for: ar-SA, de-DE, en-US [20:09:26]: Do you want to overwrite the existing promo screenshots? (y/n) y /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /opt/homebrew/bin/drawText /Users/gio/Developer/a8c/wcios/vendor/bundle/ruby/3.2.0/gems/fastlane-plugin-wpmreleasetoolkit-13.8.1/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb:410: warning: passing a block without an image argument is deprecated ... ``` --- .../plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb index 38fdab80c..c1effd787 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb @@ -33,7 +33,7 @@ def initialize UI.user_error!(message) end - UI.user_error!('`drawText` not found – install it using `brew install automattic/build-tools/drawText`.') unless system('command -v drawText') + UI.user_error!('`drawText` not found – install it using `brew install automattic/build-tools/drawText`.') unless system('command -v drawText > /dev/null') end def read_config(config_file_path) From 922a8ba9bc1c865192e4d7b16569db59b0537878 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 15 Jan 2026 20:25:01 +1100 Subject: [PATCH 2/4] Suggests runing screenshots generation when file not found Felt pretty dumb when I looked in the screenshots folder and realized that it was empty because, duh, I didn't run the automation. --- .../wpmreleasetoolkit/helper/promo_screenshots_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb index c1effd787..d1ec9c9a1 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb @@ -432,8 +432,12 @@ def resolve_path(path) return resolved_path if !resolved_path.nil? && resolved_path.exist? end - message = "Unable to locate #{path}" - UI.crash!(message) + message = <<~MESSAGE + Unable to locate #{path}. + + Did you run the automation to generate the screenshots? + MESSAGE + UI.user_error!(message) end def resolve_text_into_path(text, locale) From 95ed576d550ba08955074cbd70db4b96c5d8e04c Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 15 Jan 2026 21:06:48 +1100 Subject: [PATCH 3/4] Address deprecation warning in RMagick See how https://github.com/rmagick/rmagick/pull/1279 addressed the same issue. --- .../wpmreleasetoolkit/helper/promo_screenshots_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb index d1ec9c9a1..c970d2d72 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb @@ -407,8 +407,8 @@ def create_image(width, height, background = 'transparent') working_background = background.frozen? ? background.dup : background working_background.paint.to_hex - Image.new(width, height) do - self.background_color = working_background + Image.new(width, height) do |info| + info.background_color = working_background end end From 5740c60ec481816be53fbb2a4bc195284cd945d9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 15 Jan 2026 21:08:11 +1100 Subject: [PATCH 4/4] Use `system` over `Action.sh` to call `drawText` Doing so prevents printing the long `drawText` message and making the logs noisy. I tried using `command:` and `log: false` to silence that (as per https://github.com/fastlane/fastlane/pull/14945) but it didn't work. --- .../helper/promo_screenshots_helper.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb index c970d2d72..b4c17c614 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb @@ -287,7 +287,16 @@ def draw_text_to_canvas(canvas, text, width, height, x_position, y_position, fon begin temp_text_file = Tempfile.new - Action.sh('drawText', "html=#{text}", "maxWidth=#{width}", "maxHeight=#{height}", "output=#{temp_text_file.path}", "fontSize=#{font_size}", "stylesheet=#{stylesheet_path}", "alignment=#{position}") + system( + 'drawText', + "html=#{text}", + "maxWidth=#{width}", + "maxHeight=#{height}", + "output=#{temp_text_file.path}", + "fontSize=#{font_size}", + "stylesheet=#{stylesheet_path}", + "alignment=#{position}" + ) text_content = open_image(temp_text_file.path).trim text_frame = create_image(width, height)