Skip to content

Instantly share code, notes, and snippets.

@Pageboy
Forked from alexkreidler/fix_atom_updates.sh
Created November 28, 2017 13:16
Show Gist options
  • Save Pageboy/ba75a214268ed18ec1839d57c1c10364 to your computer and use it in GitHub Desktop.
Save Pageboy/ba75a214268ed18ec1839d57c1c10364 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Steps to fix Atom not updating properly on Mac OS, as described at
# https://discuss.atom.io/t/i-am-unable-to-update-to-the-latest-version-of-atom-on-macos-how-do-i-fix-this/40054
dirs=(/Applications/Atom.app/ ~/Library/Caches/com.github.atom.ShipIt ~/Library/Application\ Support/com.github.atom.ShipIt)
for dir in "${dirs[@]}"; do
echo "$dir"
if [ -d "$dir" ]; then
echo "Exists: $dir"
if [ ! $(stat -f "%Su" "$dir") == "$(whoami)" ]; then
echo "Bad permissions: $dir"
sudo chown -R $(whoami) "$dir"
fi
fi
done;
# Once done, open Atom, and start the update proccess. When Atom closes, wait a few (~5) mins for it to reopen.
# If it doesn't reopen, go back to troubleshooting!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment