-
-
Save jimklo/18a3704ab9296ff4f59a4863046bdb21 to your computer and use it in GitHub Desktop.
completely remove all xcode files
This file contains 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