add [Nerd Fonts] prefix to output

This commit is contained in:
morrme 2017-05-13 17:02:53 -05:00
parent a6a238f101
commit 7b41e7b298
9 changed files with 35 additions and 24 deletions

View file

@ -9,7 +9,7 @@
LINE_PREFIX="# [Nerd Fonts] "
cd ../../patched-fonts/ || {
echo >&2 "# Could not find patched fonts directory"
echo >&2 "$LINE_PREFIX Could not find patched fonts directory"
exit 1
}

View file

@ -3,9 +3,11 @@
# version: 1.0.0
# Executes the 2to3 conversion to generate latest py3 version of font patcher
LINE_PREFIX="# [Nerd Fonts] "
# Check for 2to3
type 2to3 >/dev/null 2>&1 || {
echo >&2 "# 2to3 must be installed before running this script."
echo >&2 "$LINE_PREFIX 2to3 must be installed before running this script."
echo >&2 "# Please see details at"
echo >&2 "# https://docs.python.org/2/library/2to3.html"
exit 1

View file

@ -13,9 +13,10 @@ downloadarchive="https://github.com/ryanoasis/nerd-fonts/releases/download/v#{ve
sha256sum=":no_check"
appcast="https://github.com/ryanoasis/nerd-fonts/releases.atom"
appcastcheckpoint=$(curl --compressed --location --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' "https://github.com/ryanoasis/nerd-fonts/releases.atom" | sed 's|<pubDate>[^<]*</pubDate>||g' | shasum --algorithm 256 | head -c 64)
LINE_PREFIX="# [Nerd Fonts] "
cd $patched_parent_dir || {
echo >&2 "# Could not find patched fonts directory"
echo >&2 "$LINE_PREFIX Could not find patched fonts directory"
exit 1
}
@ -66,7 +67,7 @@ function write_body {
done
else
echo "# Did not find TTF or OTF"
echo "$LINE_PREFIX Did not find TTF or OTF"
fi
}
@ -104,7 +105,7 @@ do
formattedbasename=$(echo "$basename" | tr "[:upper:]" "[:lower:]")
echo "# Generating cask for: $fontdir"
echo "$LINE_PREFIX Generating cask for: $fontdir"
[[ -d "$outputdir" ]] || mkdir -p "$outputdir"

View file

@ -16,7 +16,7 @@ output_cheat_sheet_file="../../temp/nerd-fonts-generated-cheat-sheet.txt"
$header_css_file > "$output_css_file"
# describe how the classes were established
printf "\n/* The following is generated from the build script: */\n" > "$output_css_file"
printf "\n/*[Nerd Fonts] The following is generated from the build script: */\n" > "$output_css_file"
echo;

View file

@ -10,9 +10,10 @@ parent_dir="${PWD}/../../"
unpatched_parent_dir="../../src/unpatched-fonts/"
to="$parent_dir/10-nerd-font-symbols.conf"
symbolfont="Symbols Nerd Font"
LINE_PREFIX="# [Nerd Fonts] "
cd $unpatched_parent_dir || {
echo >&2 "# Could not find patched fonts directory"
echo >&2 "$LINE_PREFIX Could not find patched fonts directory"
exit 1
}
@ -43,7 +44,7 @@ do
then
familyname=$(fc-query --format='%{family}' "${FONTS[0]}")
echo "# Generating fontconfig for: $familyname"
echo "$LINE_PREFIX Generating fontconfig for: $familyname"
# add to the file
{

View file

@ -4,9 +4,11 @@
# used for debugging
#set -x
LINE_PREFIX="# [Nerd Fonts] "
# Check for Fontforge
type fontforge >/dev/null 2>&1 || {
echo >&2 "# FontForge must be installed before running this script."
echo >&2 "$LINE_PREFIX FontForge must be installed before running this script."
echo >&2 "# Please see installation instructions at"
echo >&2 "# http://designwithfontforge.com/en-US/Installing_Fontforge.html"
exit 1
@ -31,14 +33,14 @@ max_parallel_process=64
if [ $# -eq 1 ]
then
like_pattern=$1
echo "# Parameter given, limiting search and patch to pattern '$like_pattern' given"
echo "$LINE_PREFIX Parameter given, limiting search and patch to pattern '$like_pattern' given"
fi
# simple second param option to allow to regenerate font info without re-patching
if [ $# -eq 2 ]
then
info_only=$2
echo "# 'Info Only' Parameter given, only generating font info (not patching)"
echo "$LINE_PREFIX 'Info Only' Parameter given, only generating font info (not patching)"
fi
# correct way to output find results into an array (when files have space chars, etc)
@ -49,7 +51,7 @@ source_fonts=()
done < <(find "$source_fonts_dir" -name "$like_pattern*.[o,t]tf" -type f -print0)
# print total number of source fonts found
echo "# Total source fonts found: ${#source_fonts[*]}"
echo "$LINE_PREFIX Total source fonts found: ${#source_fonts[*]}"
function patch_font {
@ -157,7 +159,7 @@ function generate_info {
# if first time with this font then re-build parent dir readme, else skip:
if [[ $config_parent_dir != "$last_parent_dir" && (! $is_unpatched_fonts_root) ]];
then
echo "Re-generate parent directory readme"
echo "[Nerd Fonts] Re-generate parent directory readme"
generate_readme "$patched_font_dir/.."
fi
@ -184,7 +186,7 @@ function generate_readme {
then
cat "$patched_font_dir/font-info.md" >> "$combinations_filename"
else
echo "# Could not append font-info.md (file not found). Was standardize script run? It should be executed first"
echo "$LINE_PREFIX Could not append font-info.md (file not found). Was standardize script run? It should be executed first"
echo "# looked for: $font_info"
fi
@ -219,7 +221,7 @@ then
# for now set a 'wait' for each X set of processes:
if [[ $(($i % $max_parallel_process)) == 0 ]];
then
echo "complete_variation_count after max parallel proc is $complete_variation_count"
echo "[Nerd Fonts] complete_variation_count after max parallel proc is $complete_variation_count"
wait
fi
done
@ -243,7 +245,7 @@ dt3=$(echo "$dt2-3600*$dh" | bc)
dm=$(echo "$dt3/60" | bc)
ds=$(echo "$dt3-60*$dm" | bc)
printf "# Total runtime: %d:%02d:%02d:%02d\n" "$dd" "$dh" "$dm" "$ds"
printf "$LINE_PREFIX Total runtime: %d:%02d:%02d:%02d\n" "$dd" "$dh" "$dm" "$ds"
printf "# All fonts patched to sub-directories in \t\t\t'%s'\n" "$patched_parent_dir"
printf "# The total number of font typefaces patched was \t\t'%s'\n" "$font_typefaces_count"

View file

@ -3,9 +3,11 @@
# calls the necessary scripts in the necessary order to prepare for a release
#set -x
LINE_PREFIX="# [Nerd Fonts] "
if [ ! $# -eq 1 ]
then
echo "# No release version given, must give semver release versionin format: #.#.#, e.g. 1.1.0"
echo "$LINE_PREFIX No release version given, must give semver release versionin format: #.#.#, e.g. 1.1.0"
fi
release=$1

View file

@ -7,9 +7,10 @@
infofilename="font-info.md"
unpatched_parent_dir="src/unpatched-fonts"
patched_parent_dir="patched-fonts"
LINE_PREFIX="# [Nerd Fonts] "
cd ../../src/unpatched-fonts/ || {
echo >&2 "# Could not find source fonts directory"
echo >&2 "$LINE_PREFIX Could not find source fonts directory"
exit 1
}
@ -36,7 +37,7 @@ do
MD=( $(find "$searchdir" -type f -iname 'readme.md') )
outputdir=$PWD/../../patched-fonts/$filename/
echo "# Generating readme for: $filename"
echo "$LINE_PREFIX Generating readme for: $filename"
[[ -d "$outputdir" ]] || mkdir -p "$outputdir"
@ -45,7 +46,7 @@ do
then
for i in "${RST[@]}"
do
echo "## Found RST"
echo "#$LINE_PREFIX Found RST"
from="$PWD/$i"
to_dir="${PWD/$unpatched_parent_dir/$patched_parent_dir}/$filename"
@ -63,7 +64,7 @@ do
then
for i in "${TXT[@]}"
do
echo "## Found TXT"
echo "#$LINE_PREFIX Found TXT"
from="$PWD/$i"
to_dir="${PWD/$unpatched_parent_dir/$patched_parent_dir}/$filename"
@ -81,7 +82,7 @@ do
then
for i in "${MD[@]}"
do
echo "## Found MD"
echo "#$LINE_PREFIX Found MD"
from="$PWD/$i"
to_dir="${PWD/$unpatched_parent_dir/$patched_parent_dir}/$filename"
@ -96,7 +97,7 @@ do
cat "$PWD/../../src/readme-per-directory-addendum.md" >> "$to"
done
else
echo "# Did not find RST nor TXT"
echo "$LINE_PREFIX Did not find RST nor TXT"
fi
done

View file

@ -6,9 +6,11 @@
# todo take some ideas from: https://github.com/fsaintjacques/semver-tool
#set -x
LINE_PREFIX="# [Nerd Fonts] "
if [ ! $# -eq 1 ]
then
echo "# No release version given, must give semver release versionin format: #.#.#, e.g. 1.1.0"
echo "$LINE_PREFIX No release version given, must give semver release versionin format: #.#.#, e.g. 1.1.0"
fi
release=$1