mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2026-09-10 07:36:35 -04:00
fc_install: Asset list without \0
When we want to cache the information we can not use strings with embedded zero characters. Instead we use vertical bar as separator and know that neither the name nor the asset number can contain blanks. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
e0bd379b8d
commit
428d713e24
12
fc_install
12
fc_install
|
|
@ -246,7 +246,7 @@ nerd.released_archives() {
|
|||
if [[ "${line}" =~ ${end1_regex} ]] && [ -n "${aid}" ]; then
|
||||
# Select only one suffix
|
||||
if [[ "${name}" == *"${archive_suffix}" ]]; then
|
||||
printf "%s %s\0" "${name%"${archive_suffix}"}" "${aid}"
|
||||
printf "%s|%s\n" "${name%"${archive_suffix}"}" "${aid}"
|
||||
fi
|
||||
aid=
|
||||
fi
|
||||
|
|
@ -255,20 +255,20 @@ nerd.released_archives() {
|
|||
|
||||
nerd.font_list() {
|
||||
nerd.released_archives | \
|
||||
while IFS= read -d $'\0' -r line; do
|
||||
while IFS= read -r line; do
|
||||
if [[ "${line}" == *FontPatcher* ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "${line%% *}"
|
||||
echo "${line%%|*}"
|
||||
done
|
||||
}
|
||||
|
||||
nerd.find_asset_id() {
|
||||
local aid=
|
||||
nerd.released_archives | \
|
||||
while IFS= read -d $'\0' -r line; do
|
||||
if [ "${line%% *}" = "${1}" ]; then
|
||||
echo "${line#* }"
|
||||
while IFS= read -r line; do
|
||||
if [ "${line%%|*}" = "${1}" ]; then
|
||||
echo "${line#*|}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue