1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-06 21:49:40 +02:00

archive-fonts: Make PWD independent

[why]
Scripts should run regardless of current working directory.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-06-02 12:52:53 +02:00 committed by Fini
parent 6b49625585
commit c4a3e0249e

View File

@ -12,13 +12,12 @@
set -e set -e
LINE_PREFIX="# [Nerd Fonts] " LINE_PREFIX="# [Nerd Fonts] "
scripts_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/" root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}/../..")" >/dev/null 2>&1 || exit && pwd -P)"
parent_dir="${PWD}/../../" outputdir=${root_dir}/archives
outputdir=$scripts_root_dir../../archives
mkdir -p "$outputdir" mkdir -p "$outputdir"
cd "$scripts_root_dir/../../patched-fonts/" || { cd "${root_dir}/patched-fonts/" || {
echo >&2 "$LINE_PREFIX Could not find patched fonts directory" echo >&2 "$LINE_PREFIX Could not find patched fonts directory"
exit 1 exit 1
} }
@ -37,7 +36,7 @@ fi
# create a mini readme with basic info on Nerd Fonts project # create a mini readme with basic info on Nerd Fonts project
touch "$outputdir/readme.md" touch "$outputdir/readme.md"
mini_readme="$outputdir/readme.md" mini_readme="$outputdir/readme.md"
cat "$parent_dir/src/archive-readme.md" >> "$mini_readme" cat "$root_dir/src/archive-readme.md" >> "$mini_readme"
# clear out the directory zips # clear out the directory zips
find "${outputdir:?}" -name "$search_pattern" -type f -delete find "${outputdir:?}" -name "$search_pattern" -type f -delete