1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-31 12:27:22 +02:00

patch-em-all: Display error messages if patching fails

[why]
All error stream outputs of `font-patcher` are suppressed, because they
are very noisy and usually are ignored.
But when the patching fails for some reason we do not know why.
Especially if that happens during CI runs.

[how]
Instead of dropping the stderr we store it in an envvar; and output it
to stdout if patching failed.

`printf` is needed because `echo` is lousy with multiple lines.

Redirection magic:
https://stackoverflow.com/questions/962255/how-to-store-standard-error-in-a-variable
https://stackoverflow.com/a/56577569

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-09-07 11:10:57 +02:00
parent aaf2dafda4
commit ef1f35368e

View File

@ -142,8 +142,14 @@ function patch_font {
}
# Use absolute path to allow fontforge being an AppImage (used in CI)
PWD=`pwd`
fontforge -quiet -script $PWD/font-patcher "$f" -q --also-windows $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
fontforge -quiet -script $PWD/font-patcher "$f" -q -s ${font_config} --also-windows $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags 2>/dev/null
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q --also-windows $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags"
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q --also-windows $powerline $post_process --complete --no-progressbars \
--outputdir "${patched_font_dir}complete/" $config_patch_flags 2>&1 1>&3 3>&- ); } 3>&1
if [ $? -ne 0 ]; then printf "$OUT\n"; fi
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q -s ${font_config} --also-windows $powerline $post_process --complete --no-progressbars --outputdir "${patched_font_dir}complete/" $config_patch_flags"
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q -s ${font_config} --also-windows $powerline $post_process --complete --no-progressbars \
--outputdir "${patched_font_dir}complete/" $config_patch_flags 2>&1 1>&3 3>&- ); } 3>&1
if [ $? -ne 0 ]; then printf "$OUT\n"; fi
# wait for this group of background processes to finish to avoid forking too many processes
# that can add up quickly with the number of combinations
#wait