✨ (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:
26
install.sh
26
install.sh
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user