From 29b82b798cac0caba8d821c7d5d1bcec7460d375 Mon Sep 17 00:00:00 2001 From: zouyanlong Date: Mon, 8 Sep 2025 09:34:32 +0800 Subject: [PATCH 1/2] fix --- scripts/install.sh | 2 +- scripts/uninstall.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index e2e630b1..60d2931a 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -374,7 +374,7 @@ function uninstall_process() { delete_empty_recursion $1 fi if [ "$2" == "y" -a -z "$(ls $atb_dir)" ];then - rm -rf "$atb_dir" + [[ -d "$atb_dir" ]] && rm -rf "$atb_dir" fi print "INFO" "Ascend-cann-atb $(basename $1) uninstall success!" } diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 34fc9d04..792b7ff5 100644 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -140,7 +140,7 @@ function uninstall_process() { delete_empty_recursion $1 fi if [ -z "$(ls $atb_dir)" ];then - rm -rf "$atb_dir" + [[ -d "$atb_dir" ]] && rm -rf "$atb_dir" fi print "INFO" "Ascend-cann-atb uninstall $(basename $1) success!" } -- Gitee From 6890af1e36940fd9d544320f5b42b70461c47c9c Mon Sep 17 00:00:00 2001 From: zouyanlong Date: Mon, 8 Sep 2025 10:12:09 +0800 Subject: [PATCH 2/2] fix --- scripts/install.sh | 4 ++-- scripts/uninstall.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 60d2931a..bd359dda 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -373,8 +373,8 @@ function uninstall_process() { if [ -d $1 ];then delete_empty_recursion $1 fi - if [ "$2" == "y" -a -z "$(ls $atb_dir)" ];then - [[ -d "$atb_dir" ]] && rm -rf "$atb_dir" + if [[ -d "$atb_dir" ]] && [ "$2" == "y" -a -z "$(ls $atb_dir)" ];then + rm -rf "$atb_dir" fi print "INFO" "Ascend-cann-atb $(basename $1) uninstall success!" } diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 792b7ff5..09fabc8a 100644 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -139,8 +139,8 @@ function uninstall_process() { if [ -d $1 ];then delete_empty_recursion $1 fi - if [ -z "$(ls $atb_dir)" ];then - [[ -d "$atb_dir" ]] && rm -rf "$atb_dir" + if [[ -d "$atb_dir" ]] && [ -z "$(ls $atb_dir)" ];then + rm -rf "$atb_dir" fi print "INFO" "Ascend-cann-atb uninstall $(basename $1) success!" } -- Gitee