From 354eca5e77ae6b9a6f0f94f3c67ae95bafdd761b Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Fri, 28 Apr 2023 12:00:45 +0200 Subject: [PATCH] On check-font runs, place docu in correct tree [why] When we run gotta-patch-em with -c the font files and the licenses will end up in check-fonts/ and not in patched_fonts/. Since gotta-patch-em calls standardize to add the readmes, the readmes will always end up in patched_fonts/, even on check runs. [how] Add option to standardize, that transports the destrination tree root. Signed-off-by: Fini Jastrow --- bin/scripts/gotta-patch-em-all-font-patcher!.sh | 4 ++-- bin/scripts/standardize-and-complete-readmes.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/scripts/gotta-patch-em-all-font-patcher!.sh b/bin/scripts/gotta-patch-em-all-font-patcher!.sh index 6d59ba3ca..37851b2af 100755 --- a/bin/scripts/gotta-patch-em-all-font-patcher!.sh +++ b/bin/scripts/gotta-patch-em-all-font-patcher!.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Nerd Fonts Version: 3.0.0 -# Script Version: 1.4.0 +# Script Version: 1.4.1 # # You can supply options to the font-patcher via environment variable NERDFONTS # That option will override the defaults (also defaults of THIS script). @@ -307,7 +307,7 @@ function generate_info { if [ "$last_font_root" != "$font_root" ] then echo "$LINE_PREFIX --- Calling standardize-and-complete-readmes for $font_root" - ./standardize-and-complete-readmes.sh "$font_root" + ./standardize-and-complete-readmes.sh "$font_root" "$patched_parent_dir" echo "$LINE_PREFIX ---" last_font_root=$font_root fi diff --git a/bin/scripts/standardize-and-complete-readmes.sh b/bin/scripts/standardize-and-complete-readmes.sh index b2bff06e1..3ba912191 100755 --- a/bin/scripts/standardize-and-complete-readmes.sh +++ b/bin/scripts/standardize-and-complete-readmes.sh @@ -40,7 +40,7 @@ function clearDestination { true > "$to" 2> /dev/null } -if [ $# -eq 1 ]; then +if [ $# -ge 1 ]; then like_pattern="./$1" # allows one to limit to specific font. # e.g. with ProFont, DejaVuSansMon, Hasklig, Hack, Gohu, FiraCode, Hermit, etc. @@ -49,6 +49,10 @@ else like_pattern="." echo "$LINE_PREFIX No parameter pattern given, generating standardized readmes for all fonts in all font directories" fi +if [ $# -ge 2 ]; then + patched_parent_dir=$2 + echo "$LINE_PREFIX Using destination '${patched_parent_dir}'" +fi find "$like_pattern" -type d | while read -r filename @@ -88,7 +92,7 @@ do mapfile -t RST < <(find "$searchdir" -type f -iname 'readme.rst') mapfile -t TXT < <(find "$searchdir" -type f -iname 'readme.txt') mapfile -t MD < <(find "$searchdir" -type f -iname 'readme.md') - outputdir=$PWD/../../patched-fonts/$filename/ + outputdir=$PWD/../../${patched_parent_dir}/$filename/ echo "$LINE_PREFIX Generating readme for: $filename"