From 6afc4b1aa7dc280a45074ef34276199598c8ffa1 Mon Sep 17 00:00:00 2001 From: daniel0alves Date: Wed, 14 Jan 2026 12:30:47 +0000 Subject: [PATCH] fix on uninstall script with -r --- sdata/subcmd-uninstall/0.run.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sdata/subcmd-uninstall/0.run.sh b/sdata/subcmd-uninstall/0.run.sh index 380da51a7..ce66cf554 100644 --- a/sdata/subcmd-uninstall/0.run.sh +++ b/sdata/subcmd-uninstall/0.run.sh @@ -45,7 +45,12 @@ function delete_targets(){ printf "${STY_YELLOW}Target \"$path\" inexists, skipping...${STY_RST}\n" continue elif [[ "$path" == "$HOME"* ]]; then - x rm -- "$path" + if [[ -d "$path" ]]; then + x rm -r -- "$path" + else + x rm -- "$path" + fi + else while true; do printf "WARNING: Target \"$path\" is not under \$HOME. Still delete it?\ny=Yes, delete it;\nn=No, skip this one\n" @@ -53,7 +58,11 @@ function delete_targets(){ echo case "$ans" in y|Y) - x rm -- "$path" + if [[ -d "$path" ]]; then + x rm -r -- "$path" + else + x rm -- "$path" + fi break 1 ;; n|N)