From: Jaehoon Chung Date: Fri, 27 Oct 2023 11:18:26 +0000 (+0900) Subject: scripts: delta-generation: Check if there is a path X-Git-Tag: accepted/tizen/unified/20240419.110853~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a15fc3ca97a23b2526a33134ec1d49b808f9de7;p=platform%2Fcore%2Fsystem%2Fupgrade-tools.git 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 --- 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