mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
Allow a single font-family to be installed, instead of everything by default.
This commit is contained in:
parent
ac8061c9f9
commit
4ac26ee202
1 changed files with 21 additions and 1 deletions
20
install.sh
20
install.sh
|
@ -3,6 +3,21 @@
|
||||||
# Set source and target directories
|
# Set source and target directories
|
||||||
powerline_fonts_dir="${PWD}/patched-fonts"
|
powerline_fonts_dir="${PWD}/patched-fonts"
|
||||||
|
|
||||||
|
# Accept a font / directory name, to avoid installing all fonts
|
||||||
|
if [ ! -z "$1" ];
|
||||||
|
then
|
||||||
|
# Ensure thar directory exists, and offer suggestions if not
|
||||||
|
|
||||||
|
if [[ ! -d "$powerline_fonts_dir/$1" ]];
|
||||||
|
then
|
||||||
|
echo -e "That font directory doesn't exist. Options are: \n"
|
||||||
|
ls "$powerline_fonts_dir"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
powerline_fonts_dir="$powerline_fonts_dir/$1"
|
||||||
|
fi
|
||||||
|
|
||||||
find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0"
|
find_command="find \"$powerline_fonts_dir\" \( -name '*.[o,t]tf' -or -name '*.pcf.gz' \) -type f -print0"
|
||||||
|
|
||||||
if [[ $(uname) == 'Darwin' ]]; then
|
if [[ $(uname) == 'Darwin' ]]; then
|
||||||
|
@ -22,4 +37,9 @@ if [[ -n $(which fc-cache) ]]; then
|
||||||
fc-cache -f "$font_dir"
|
fc-cache -f "$font_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$1" ];
|
||||||
|
then
|
||||||
|
echo "$1 font installed to $font_dir"
|
||||||
|
else
|
||||||
echo "All fonts installed to $font_dir"
|
echo "All fonts installed to $font_dir"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue