#!/usr/bin/env bash echo "Downloading 'font-patcher' script..." curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/font-patcher -o ./font-patcher chmod 755 ./font-patcher for path in codicons font-awesome powerline-symbols weather-icons; do mkdir -p ./src/glyphs/"$path" done echo "Downloading glyph fonts..." glyphs=( "codicons/codicon.ttf" "font-awesome/FontAwesome.otf" "materialdesign/MaterialDesignIconsDesktop.ttf" "materialdesign/MaterialDesignIconsDesktop_orig.ttf" "powerline-symbols/PowerlineSymbols.otf" "weather-icons/weathericons-regular-webfont.ttf" "Pomicons.otf" "PowerlineExtraSymbols.otf" "Unicode_IEC_symbol_font.otf" "devicons.ttf" "extraglyphs.sfd" "font-awesome-extension.ttf" "font-logos.ttf" "materialdesignicons-webfont.ttf" "octicons.ttf" "original-source.otf" ) upstream_src_glyphs_url="https://github.com/ryanoasis/nerd-fonts/raw/master/src/glyphs" for glyph in "${glyphs[@]}"; do # replace all `whitespace` characters with `%20` percent_encoded_uri="${upstream_src_glyphs_url}/${glyph//\ /%20}" curl -fSL ${percent_encoded_uri} -o "src/glyphs/${glyph}" done find ./src/glyphs/ -type f -exec chmod 644 '{}' \;