Created
November 1, 2014 16:57
-
-
Save matti/38dc66ff26f165f35fc8 to your computer and use it in GitHub Desktop.
completely remove all xcode files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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