Created
March 12, 2017 02:28
-
-
Save victorono/8fb2b87f041c5fc4dc647ebd6309aef1 to your computer and use it in GitHub Desktop.
Install all Google Web Fonts onto your local machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# OS detect | |
osdetect=$(uname) | |
file_path="unknown" | |
if [[ "$osdetect" == 'Linux' ]]; then | |
file_path="sudo mv fonts/* /usr/local/share/fonts/" | |
elif [[ "$osdetect" == 'Darwin' ]]; then | |
file_path="mv fonts/* /Library/Fonts/" | |
elif [[ "$osdetect" == 'Arch Linux' ]]; then | |
file_path="sudo mv fonts/* /usr/share/fonts/" | |
fi | |
clear | |
echo "Installing all Google Web Fonts onto your System" | |
echo "Downloading the fonts..." | |
cd ~ | |
curl -L https://github.com/google/fonts/tarball/master -o master.tar.gz | |
echo "Extracting the fonts..." | |
mkdir -p goog-fonts/fonts | |
tar -zxf master.tar.gz -C goog-fonts/fonts | |
cd goog-fonts | |
cd fonts | |
find . -mindepth 2 -type f -print -exec mv {} . \; | |
rm -R -- */ | |
rm *.txt | |
rm *.json | |
rm *.csv | |
rm *.md | |
rm *.html | |
rm *.py | |
rm AUTHORS | |
rm CONTRIBUTORS | |
cd .. | |
$file_path | |
echo "Fonts installed; Cleaning up files..." | |
cd ~ | |
rm -f master.tar.gz | |
rm -rf goog-fonts | |
echo "All done! All Google Fonts installed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment