1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-01 16:55:57 +02:00

generate-casks: Simplify jq call

[why]
The json file is transported to jq via pipe AND as file.
That is not needed of course.

[how]
Just use the filename.

[note]
Also some whitespace changes.
Also remove debug output.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-11-29 22:52:43 +01:00 committed by Fini
parent a1c9300076
commit c5cb976db8

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 2.3.0-RC
# Script Version: 2.0.0
# Script Version: 2.1.1
# Iterates over all [*] patched fonts directories
# to generate ruby cask files for homebrew-fonts (https://github.com/caskroom/homebrew-fonts)
# * Only adds non-Windows versions of the fonts
@ -157,8 +157,8 @@ while read -r filename; do
sha256sum=$(sha256sum "../archives/${basename}.zip" | head -c 64)
searchdir=$filename
originalname=$(cat "${scripts_root_dir}/lib/fonts.json" | jq -r ".fonts[] | select(.folderName == "\"${basename}\"") | .unpatchedName" "${scripts_root_dir}/lib/fonts.json" | head -n 1)
caskbasename=$(cat "${scripts_root_dir}/lib/fonts.json" | jq -r ".fonts[] | select(.folderName == "\"${basename}\"") | .caskName" "${scripts_root_dir}/lib/fonts.json" | head -n 1)
originalname=$(jq -r ".fonts[] | select(.folderName == "\"${basename}\"") | .unpatchedName" "${scripts_root_dir}/lib/fonts.json" | head -n 1)
caskbasename=$(jq -r ".fonts[] | select(.folderName == "\"${basename}\"") | .caskName" "${scripts_root_dir}/lib/fonts.json" | head -n 1)
if [ -z "$originalname" ]; then
echo "${LINE_PREFIX} Can not find ${basename} in fonts.json, skipping..."
continue
@ -177,7 +177,6 @@ while read -r filename; do
caskname="font-${caskbasename}-nerd-font"
to="$outputdir/${caskname}.rb"
echo "@@@$caskname@@@"
clear_file "$to"
write_header "$to" "$caskname"