Skip to content

Instantly share code, notes, and snippets.

@matti
Created November 1, 2014 16:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save matti/38dc66ff26f165f35fc8 to your computer and use it in GitHub Desktop.
Save matti/38dc66ff26f165f35fc8 to your computer and use it in GitHub Desktop.
completely remove all xcode files
#!/usr/bin/env ruby
cancer_in_home = [
"Library/Developer",
"Library/Preferences/com.apple.dt.*",
"Library/Caches/com.apple.dt.*",
'Library/Application\ Support/Xcode'
]
cancer_in_root = [
"/Library/Preferences/com.apple.dt.Xcode.plist"
]
def remove(path, sudo=false)
sudocmd = if sudo
"sudo "
else
""
end
`#{sudocmd}rm -rf #{path}`
puts "#{path} nuked"
end
for home_path in cancer_in_home do
remove("$HOME/#{home_path}")
end
for path in cancer_in_root do
remove(path, true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment