(install.sh, install_nvm.sh): refactor font installation logic to check for existing fonts before downloading, and remove redundant echo statement in install_nvm.sh

This commit is contained in:
Frank Qing
2025-05-28 15:11:24 +08:00
parent 18a56766c6
commit 5088da8a75
4 changed files with 55 additions and 5 deletions

View File

@@ -248,9 +248,29 @@ fi
echo -e "Installing Nerd Fonts version of Hack, Roboto Mono, DejaVu Sans Mono\n"
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/HackNerdFont-Regular.ttf -P ~/.fonts/
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/RobotoMono/Regular/RobotoMonoNerdFont-Regular.ttf -P ~/.fonts/
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/DejaVuSansMNerdFont-Regular.ttf -P ~/.fonts/
# Check and download Hack font if it doesn't exist
if [ ! -f ~/.fonts/HackNerdFont-Regular.ttf ]; then
echo "Downloading Hack Nerd Font..."
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/HackNerdFont-Regular.ttf -P ~/.fonts/
else
echo "Hack Nerd Font already exists, skipping download."
fi
# Check and download Roboto Mono font if it doesn't exist
if [ ! -f ~/.fonts/RobotoMonoNerdFont-Regular.ttf ]; then
echo "Downloading Roboto Mono Nerd Font..."
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/RobotoMono/Regular/RobotoMonoNerdFont-Regular.ttf -P ~/.fonts/
else
echo "Roboto Mono Nerd Font already exists, skipping download."
fi
# Check and download DejaVu Sans Mono font if it doesn't exist
if [ ! -f ~/.fonts/DejaVuSansMNerdFont-Regular.ttf ]; then
echo "Downloading DejaVu Sans Mono Nerd Font..."
wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/DejaVuSansMNerdFont-Regular.ttf -P ~/.fonts/
else
echo "DejaVu Sans Mono Nerd Font already exists, skipping download."
fi
fc-cache -fv ~/.fonts