-
-
Save theclue/1b5783b4e0162bc7262b23900b62d327 to your computer and use it in GitHub Desktop.
Install all Google Web Fonts onto your local machine
This file contains hidden or 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