#!/bin/bash
# - bof - #



<<'comment'
  See instructions below for ubuntu & arch installations.
comment



Dir_=($PWD);
sNf_="nerdFonts";



declare -a aF_=(
BitstreamVeraSansMono
DroidSansMono
CascadiaCode
JetBrainsMono
)



<<'comment'

# -  - #
# - nerdFonts.sh - #

# -  - #
# - Method  # 1 - #
sh -c "$(curl -fsSL https://www.education.isdevelopment.us/nerdFonts/nerdFonts.sh)"

# -  - #
# - Method  # 2 - #
curl -o ~/nerdFonts.sh https://www.education.isdevelopment.us/nerdFonts/nerdFonts.sh
chmod +x ~/nerdFonts.sh; ~/./nerdFonts.sh;




BitstreamVeraSansMono
CascadiaCode
CodeNewRoman
DroidSansMono
FiraCode
FiraMono
Go-Mono
Hack
Hermit
JetBrainsMono
Meslo
Noto
Overpass
ProggyClean
RobotoMono
SourceCodePro
SpaceMono
Ubuntu
UbuntuMono
comment



sV_=$(curl -s 'https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest' | jq -r '.name')
if [ -z "$sV_" ] || [ "$sV_" = "null" ]; then
  $sV_="v3.2.1"; fi;

echo "latest version:$sV_"

sFdir_="${HOME}/.local/share/fonts"
#sFdir_="/usr/share/fonts"
#sFdir_=~/Downloads;

if [[ ! -d "$sFdir_" ]]; then
	mkdir -p "$sFdir_"; fi;
cd $sFdir_;



for font in "${aF_[@]}"; do
  sZ_="${font}.zip"
  sD_="https://github.com/ryanoasis/nerd-fonts/releases/download/${sV_}/${sZ_}"
  echo "Downloading $sD_..."
  wget "$sD_";
  unzip "$sZ_" -d "$sFdir_"
  rm -rf "$sZ_"
done



find "$sFdir_" -name 'Windows Compatible' -delete
fc-cache -fv
rm -rf ~/nerdFonts.sh;
cd $Dir_;



# - eof - #