Skip to content

Instantly share code, notes, and snippets.

@tracphil
Last active August 13, 2020 12:53
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 tracphil/03de0b546e83372141aea36772ba844c to your computer and use it in GitHub Desktop.
Save tracphil/03de0b546e83372141aea36772ba844c to your computer and use it in GitHub Desktop.
Script to symlink my dotfiles from iCloud
#!/bin/bash
# cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles
if [[ ! -d ~/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles ]]
then
echo "${HOME}/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles does not exist!"
exit 1
fi
mkdir -p ~/.vagrant.d
for i in .ssh .zsh* .config; do rm -rf ~/"$i"; done
rm -rf .aws/saml_cache*
for dotfile in $( ls -A1 | grep -Ev 'setup_dotfiles.sh|link.sh|bak' )
do
# touch the file so it syncs locally from iCloud
touch ${dotfile}
ln -Ffs ~/Library/Mobile\ Documents/com~apple~CloudDocs/Settings/dotfiles/${dotfile} ~/${dotfile}
done
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
if [ -d ~/.ssh ]; then
rm -rf ~/.ssh/environment
rm -rf ~/.ssh/known_hosts
fi
mkdir ~/.pyenv
cat > ~/.pyenv/requirements.txt << PYENV
aws-google-auth
awscli
editorconfig
yamllint
pygments
PYENV
echo "Do this after install"
echo ""
echo "cd ~/.zinit/completions"
echo "wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/terraform/_terraform"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment