Skip to content

Instantly share code, notes, and snippets.

@dictions
Last active October 21, 2015 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dictions/f86cdd288e756fc19b39 to your computer and use it in GitHub Desktop.
Save dictions/f86cdd288e756fc19b39 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `sync` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Reset font directories
sudo fontrestore default
# Throw extra fonts in trash
sudo rm -rf /Library/Fonts\ \(Removed\)
sudo rm -rf ~/Library/Fonts\ \(Removed\)
sudo rm -rf /System/Library/Fonts\ \(Removed\)
# Copy over the repo fonts
rsync -a -p fonts/repo*/*/. ~/Library/Fonts/.
# Copy over any user fonts
rsync -a -p fonts/user*/*/. ~/Library/Fonts/.
echo 'All done bro.'
# We probably need some error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment