2022-01-03 10:53:22 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-06-04 22:32:30 +02:00
|
|
|
# Nerd Fonts Version: 3.0.2
|
2023-02-17 09:47:00 +02:00
|
|
|
# Script Version: 1.1.0
|
2022-01-03 10:53:22 +02:00
|
|
|
# Archives the font patcher script and the required source files
|
2023-02-17 09:47:00 +02:00
|
|
|
# If some (any) argument is given this is though of as intermediate version
|
2022-01-03 10:53:22 +02:00
|
|
|
# used for debugging
|
|
|
|
# set -x
|
|
|
|
|
|
|
|
# LINE_PREFIX="# [Nerd Fonts]"
|
|
|
|
scripts_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
|
|
|
|
parent_dir="${PWD}/../../"
|
|
|
|
outputdir=$scripts_root_dir../../archives
|
|
|
|
|
|
|
|
mkdir -p "$outputdir"
|
|
|
|
|
|
|
|
# create a mini readme with basic info on Nerd Fonts project
|
|
|
|
touch "$outputdir/readme.md"
|
|
|
|
mini_readme="$outputdir/readme.md"
|
|
|
|
cat "$parent_dir/src/archive-font-patcher-readme.md" >> "$mini_readme"
|
2023-02-17 09:47:00 +02:00
|
|
|
if [ $# -ge 1 ]; then
|
|
|
|
echo "Intemediate version, adding git version"
|
2023-02-17 12:44:13 +02:00
|
|
|
echo -e "\n## Version\nThis archive is created from\n" >> "$mini_readme"
|
|
|
|
git log --pretty=medium --no-decorate --no-abbrev -n 1 HEAD | sed 's/^/ /' >> "$mini_readme"
|
2023-02-17 09:47:00 +02:00
|
|
|
fi
|
2022-01-03 10:53:22 +02:00
|
|
|
|
|
|
|
# clear out the directory zips
|
|
|
|
find "${outputdir:?}" -name "FontPatcher.zip" -type f -delete
|
|
|
|
|
|
|
|
cd -- "$scripts_root_dir/../../" || exit 1
|
2023-02-17 09:47:00 +02:00
|
|
|
find "src/glyphs" | zip -9 "$outputdir/FontPatcher" -@
|
2022-02-06 16:59:46 +02:00
|
|
|
find "bin/scripts/name_parser" -name "Fontname*.py" | zip -9 "$outputdir/FontPatcher" -@
|
2023-02-17 09:47:00 +02:00
|
|
|
find "font-patcher" | zip -9 "$outputdir/FontPatcher" -@
|
2022-01-03 10:53:22 +02:00
|
|
|
|
|
|
|
# add mini readme file
|
|
|
|
zip -9 "$outputdir/FontPatcher" -rj "$mini_readme" -q
|
|
|
|
rm -f "$mini_readme"
|
|
|
|
|
|
|
|
# @TODO check zip status
|
|
|
|
# zipStatus=$?
|
|
|
|
|
|
|
|
# if [ "$zipStatus" != "0" ]
|
|
|
|
# then
|
|
|
|
# echo "$LINE_PREFIX error, font-patcher archive not created"
|
|
|
|
# exit 1
|
|
|
|
# else
|
|
|
|
# echo "$LINE_PREFIX font-patcher archive created successfully"
|
|
|
|
# fi;
|