scripts: delta-generation: Check if there is a path 88/300588/3
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 27 Oct 2023 11:18:26 +0000 (20:18 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 30 Oct 2023 09:06:35 +0000 (18:06 +0900)
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 <jh80.chung@samsung.com>
scripts/delta-generation.sh

index 30d69aa..b9e94d0 100755 (executable)
@@ -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