1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-25 20:18:01 +02:00

Fixes for generating readmes (#136)

This commit is contained in:
Ryan L McIntyre 2017-07-23 21:26:35 -04:00
parent 2f55c7184b
commit b3329db297

View File

@ -160,10 +160,10 @@ function generate_info {
if [[ $config_parent_dir != "$last_parent_dir" ]] && [ $is_unpatched_fonts_root == "0" ];
then
echo "$LINE_PREFIX Re-generate parent directory readme"
generate_readme "$patched_font_dir/.."
generate_readme "$patched_font_dir.." 0
fi
generate_readme "$patched_font_dir"
generate_readme "$patched_font_dir" 1
last_parent_dir=$config_parent_dir
@ -175,9 +175,10 @@ function generate_info {
# Re-generate all the readmes
# $1 = fontdir path
function generate_readme {
patched_font_dir=$1
combinations_filename="$patched_font_dir/readme.md"
font_info="$patched_font_dir/font-info.md"
local patched_font_dir=$1
local generate_combinations=$2
local combinations_filename="$patched_font_dir/readme.md"
local font_info="$patched_font_dir/font-info.md"
# clear output file (needed for multiple runs or updates):
> "$combinations_filename"
@ -192,8 +193,9 @@ function generate_readme {
cat "$parent_dir/src/readme-per-directory-variations.md" >> "$combinations_filename"
if [ $unpatched_parent_dir == "0" ];
if [ "$generate_combinations" == 1 ];
then
echo "$LINE_PREFIX Adding 'Possible Combinations' section"
# add to the file
{
printf "\`\`\`sh"