mirror of
https://github.com/JaKooLit/Debian-Hyprland.git
synced 2025-12-21 02:10:13 +01:00
updated uninstall.sh to have a wildcards for removing dirs from ~/.config. This will also remove the backups
This commit is contained in:
parent
b55e2be928
commit
ea038dee51
18
uninstall.sh
18
uninstall.sh
@ -62,22 +62,24 @@ remove_packages() {
|
||||
done < "$selected_packages_file"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Function to remove selected directories
|
||||
remove_directories() {
|
||||
local selected_dirs_file=$1
|
||||
while read -r dir; do
|
||||
if [ -d "$HOME/.config/$dir" ]; then
|
||||
echo "Removing directory: $HOME/.config/$dir"
|
||||
if ! rm -rf "$HOME/.config/$dir"; then
|
||||
echo "$ERROR Failed to remove directory: $HOME/.config/$dir"
|
||||
pattern="$HOME/.config/$dir*"
|
||||
# Loop through directories matching the pattern
|
||||
for dir_to_remove in $pattern; do
|
||||
if [ -d "$dir_to_remove" ]; then
|
||||
echo "Removing directory: $dir_to_remove"
|
||||
if ! rm -rf "$dir_to_remove"; then
|
||||
echo "$ERROR Failed to remove directory: $dir_to_remove"
|
||||
else
|
||||
echo "$OK Successfully removed directory: $HOME/.config/$dir"
|
||||
echo "$OK Successfully removed directory: $dir_to_remove"
|
||||
fi
|
||||
else
|
||||
echo "$INFO Directory ${YELLOW}$HOME/.config/$dir${RESET} not found. Skipping."
|
||||
echo "$INFO Directory ${YELLOW}$dir_to_remove${RESET} not found. Skipping."
|
||||
fi
|
||||
done
|
||||
done < "$selected_dirs_file"
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user