From 3a15fc3ca97a23b2526a33134ec1d49b808f9de7 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Fri, 27 Oct 2023 20:18:26 +0900 Subject: [PATCH] scripts: delta-generation: Check if there is a path Check if there is a path. If there is no path, it will be exited. Otherwise, all files are removed under current directory It's a critical bug in this script. Change-Id: Ie3537ead4152f265d97f65e966342183a9dcd1c2 Signed-off-by: Jaehoon Chung --- scripts/delta-generation.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/delta-generation.sh b/scripts/delta-generation.sh index 30d69aa..b9e94d0 100755 --- a/scripts/delta-generation.sh +++ b/scripts/delta-generation.sh @@ -59,6 +59,11 @@ if [ ! -z "$MOUNT_LIST" ]; then fi CWD=${PWD} +if ! [ -d $TOTA_UPG_WORK ]; then + echo "$(tput setaf 1)$(tput bold)ERROR: There is no $TOTA_UPG_WORK directory. Please input correct path." + tput sgr 0 + exit +fi cd $TOTA_UPG_WORK ls | grep -vE "cfg|data" | xargs rm -rf cd data -- 2.7.4