Skip to content

Commit

Permalink
gotta-patch-em-all: Rename repo-root-dir variable
Browse files Browse the repository at this point in the history
[why]
The name `parent_dir` is a bit misleading and not precise.

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Jan 24, 2023
1 parent d9a2f1a commit 0075243
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/scripts/gotta-patch-em-all-font-patcher!.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ type fontforge >/dev/null 2>&1 || {
sd="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

res1=$(date +%s)
parent_dir=$(dirname $(dirname ${sd})) # two levels up (i.e. ../../)
repo_root_dir=$(dirname $(dirname ${sd})) # two levels up (i.e. ../../)
# Set source and target directories
source_fonts_dir="${parent_dir}/src/unpatched-fonts"
like_pattern='.*\.\(otf\|ttf\|sfd\)'
complete_variations_per_family=4
font_typefaces_count=0
Expand All @@ -33,6 +32,7 @@ last_parent_dir=""
unpatched_parent_dir="src/unpatched-fonts"
patched_parent_dir="patched-fonts"
timestamp_parent_dir=${patched_parent_dir}
source_fonts_dir="${repo_root_dir}/${unpatched_parent_dir}"
max_parallel_process=8

function activate_keeptime {
Expand Down Expand Up @@ -229,7 +229,7 @@ function patch_font {

if [ "$post_process" ]
then
post_process="--postprocess=${parent_dir}/${post_process}"
post_process="--postprocess=${repo_root_dir}/${post_process}"
else
post_process=""
fi
Expand All @@ -245,7 +245,7 @@ function patch_font {
combinations=$(printf "./font-patcher ${f##*/} %s\\n" {' --powerline',}{' --use-single-width-glyphs',}{' --windows',}{' --fontawesome',}{' --octicons',}{' --fontlogos',}{' --pomicons',}{' --powerlineextra',}{' --fontawesomeextension',}{' --powersymbols',}{' --weather',}{' --material',})
fi

cd "$parent_dir" || {
cd "$repo_root_dir" || {
echo >&2 "# Could not find project parent directory"
exit 3
}
Expand Down Expand Up @@ -389,7 +389,7 @@ function generate_readme {
if [ "$generate_combinations" == 1 ];
then
# add to the file
cat "$parent_dir/src/readme-per-directory-variations.md" >> "$combinations_filename"
cat "$repo_root_dir/src/readme-per-directory-variations.md" >> "$combinations_filename"
{
printf "\`\`\`sh"
printf "\\n# %s Possible Combinations:\\n" "$combination_count"
Expand Down

0 comments on commit 0075243

Please sign in to comment.