mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-12-01 16:55:57 +02:00
Add script to download release artifacts
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
22e5b2e98f
commit
dd75219729
@ -7,6 +7,7 @@ Note: Usually you need to call the scripts in this directory while actually bein
|
||||
* `data/`: Contains plain text files used to generate the CSS and cheat sheet files
|
||||
* `data/sankey/`: Contains instructions on how to create the sankey glyph table manually [3]
|
||||
* `docker-entrypoint.sh`: This script is packaged into the docker container and is usually used to start patching [2]
|
||||
* `fetch-archives.sh`: Script to download the release zip archives [4]
|
||||
* `fpfix.py`: Can be used to set isFixedPitch property in a font [x]
|
||||
* `generate-casks.sh`: Generates cask files for fonts from data in `patched-fonts/` and `archives/` [3]
|
||||
* `generate-css.sh`: Generates the Nerd Fonts CCS, which can be used to access the glyphs on a web page [1]
|
||||
|
46
bin/scripts/fetch-archives.sh
Executable file
46
bin/scripts/fetch-archives.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# Nerd Fonts Version: 2.3.0-RC
|
||||
# Script Version: 1.0.0
|
||||
#
|
||||
# Iterates over all patched fonts directories and fetches the current release zip files.
|
||||
#
|
||||
# set -x
|
||||
#
|
||||
# Example run with pattern matching:
|
||||
# ./archive-fonts heavydata
|
||||
# Example with same font names for different paths
|
||||
# ./archive-fonts gohu
|
||||
|
||||
version="2.3.0-RC"
|
||||
|
||||
LINE_PREFIX="# [Nerd Fonts] "
|
||||
scripts_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
|
||||
outputdir=$(realpath "${scripts_root_dir}../../archives")
|
||||
|
||||
mkdir -p "$outputdir"
|
||||
|
||||
cd "$scripts_root_dir/../../patched-fonts/" || {
|
||||
echo >&2 "${LINE_PREFIX} Could not find patched fonts directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# limit archiving to given pattern (first script param) or entire root folder if no param given:
|
||||
if [ $# -eq 1 ]
|
||||
then
|
||||
pattern=$1
|
||||
search_pattern="*$1*.zip"
|
||||
echo "$LINE_PREFIX Limiting archive to pattern '$pattern'"
|
||||
else
|
||||
pattern=".*"
|
||||
search_pattern="*.zip"
|
||||
echo "$LINE_PREFIX No limiting pattern given, will search entire folder"
|
||||
fi
|
||||
|
||||
find . -maxdepth 1 -iregex "\./$pattern" -type d |
|
||||
while read -r filename
|
||||
do
|
||||
basename=$(basename "$filename")
|
||||
echo >&2 "${LINE_PREFIX} Fetching v${version}/${basename}.zip"
|
||||
curl --fail -Lso "${outputdir}/${basename}.zip" "https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${basename}.zip" \
|
||||
|| echo " => error fetching"
|
||||
done
|
Loading…
Reference in New Issue
Block a user