nuscripts/tools/uninstall.nu

24 lines
740 B
Plaintext
Raw Normal View History

2024-01-13 10:50:06 +00:00
# Attempt to remove Homebrew directories and files
echo "Removing Homebrew directories and files..."
let homebrew_dirs = ["/usr/local/Cellar" "/usr/local/Homebrew"
"~/.cache/Homebrew" "~/Library/Caches/Homebrew" "~/Library/Logs/Homebrew"
"/usr/local/Caskroom" "/opt/homebrew" ]
for dir in $homebrew_dirs {
if ($dir | path exists) {
# rm -rfv $dir
let to_remove = $dir | str replace '~' $env.HOME
echo $to_remove
^sudo rm -r $to_remove
# if ($? == 0) {
# echo "File successfully removed"
# } else {
# echo "Failed to remove file"
# }
echo $"Removed: ($dir)"
}
}
echo "Homebrew cleanup process is complete."