mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
patch-em-all: Fix missing licenses
[why] If the license file is not in the same folder as the font file or its parent directory it will not be copied. Example: ├── AUTHORS.txt ├── config.cfg ├── copyall.sh ├── Ligatures │ ├── Bold │ │ └── JetBrainsMono-Bold.ttf │ ├── BoldItalic │ │ └── JetBrainsMono-BoldItalic.ttf ├── OFL.txt └── README.md When processing one font file (.ttf) the OFL.txt is neither in the same nor in the parent directory (but rather in the parent's parent. [how] Collect all license-ish files for a complete font set and copy them all over each other into all appropriate destinations in patched-fonts.o Note that in situations like this: ├── fonts.dir ├── fonts.scale ├── L │ ├── Bold │ │ └── Meslo LG L Bold for Powerline.ttf │ ├── config.cfg │ └── LICENSE.txt ├── LICENSE.txt └── README.rst All LICENSE.txt files will be copied, but only the last one will 'win'. So make sure all license files are identical. Fixes: #1068 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
00752430e3
commit
8a749ab210
1 changed files with 9 additions and 9 deletions
|
@ -77,6 +77,11 @@ function show_help {
|
||||||
echo " Process all font files that are in directory \"iosevka\""
|
echo " Process all font files that are in directory \"iosevka\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function find_font_root {
|
||||||
|
# e.g. /a/b/c/nerd-fonts/src/unpatched-fonts/Meslo
|
||||||
|
sed -E "s|(${unpatched_parent_dir}/[^/]*).*|\1|" <<< "$1"
|
||||||
|
}
|
||||||
|
|
||||||
while getopts ":chijtv-:" option; do
|
while getopts ":chijtv-:" option; do
|
||||||
case "${option}" in
|
case "${option}" in
|
||||||
c)
|
c)
|
||||||
|
@ -335,15 +340,10 @@ function generate_info {
|
||||||
generate_readme "$patched_font_dir" 0
|
generate_readme "$patched_font_dir" 0
|
||||||
echo "$LINE_PREFIX * Copying license files"
|
echo "$LINE_PREFIX * Copying license files"
|
||||||
|
|
||||||
if [ $is_unpatched_fonts_root == "0" ];
|
# Copy 'all' license files found in the complete font's source tree
|
||||||
then
|
# into the destination. This will overwrite all same-names files
|
||||||
# if we are not at the unpatched fonts root, copy all license from config parent dir
|
# so make sure all licenses of one fontface are identical
|
||||||
copy_license "$config_parent_dir" "$patched_font_dir"
|
copy_license "$(find_font_root $config_dir)" "$patched_font_dir"
|
||||||
else
|
|
||||||
# otherwise we nedd to copy files from the config dir itself
|
|
||||||
copy_license "$config_dir" "$patched_font_dir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
last_parent_dir=$config_parent_dir
|
last_parent_dir=$config_parent_dir
|
||||||
total_variation_count=$((total_variation_count+combination_count))
|
total_variation_count=$((total_variation_count+combination_count))
|
||||||
|
|
Loading…
Reference in a new issue