Skip to content

Instantly share code, notes, and snippets.

@tkafka
Created September 17, 2023 08:17
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 tkafka/dfa7be2b7b51d698b628492d38e37f32 to your computer and use it in GitHub Desktop.
Save tkafka/dfa7be2b7b51d698b628492d38e37f32 to your computer and use it in GitHub Desktop.
#!/bin/zsh -f
PATH=/bin
bin="${HOME}/.Trash/$(date -u +%Y-%m-%dT%H-%M-%SZ)"
if (( ${?} > 0 )); then
exit 1
fi
mkdir -p "${bin}/Library/"{'Application Support',Caches,Containers,Preferences}
mv "${HOME}/Library/Application Support/AddressBook" "${bin}/Library/Application Support" 2>/dev/null
mv "${HOME}/Library/Caches/com.apple.AddressBookSourceSync" "${bin}/Library/Caches" 2>/dev/null
mv "${HOME}/Library/Containers/com.apple.AddressBook" "${HOME}/Library/Containers/com.apple.AddressBook."* "${HOME}/Library/Containers/com.apple.ContactsAgent" "${HOME}/Library/Containers/com.apple.ContactsUI."* "${bin}/Library/Containers" 2>/dev/null
mv "${HOME}/Library/Preferences/com.apple.AddressBook.plist" "${bin}/Library/Preferences" 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment