From 7916c165b47f2679201c740f4ec38cd3d94f58d2 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Fri, 21 Oct 2022 15:49:45 +0000 Subject: [PATCH] mkdir -p --- backEndUpgrade.sh | 3 +++ checkService.sh | 4 ++++ frontEndUpgrade.sh | 6 +++++- ossUpgrade.sh | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/backEndUpgrade.sh b/backEndUpgrade.sh index 5663bfe..97e5d24 100755 --- a/backEndUpgrade.sh +++ b/backEndUpgrade.sh @@ -4,6 +4,9 @@ projectPath=$2 PATH=PATH:/usr/bin:/usr/sbin basePath=$3 +if [ ! -d $basePath ]; then + mkdir $basePath -p +fi sleep 1 cd $basePath echo "current path: $(pwd)" diff --git a/checkService.sh b/checkService.sh index 9fc259e..2ad446c 100755 --- a/checkService.sh +++ b/checkService.sh @@ -14,6 +14,10 @@ preName="${fileName%.*}" PATH=PATH:/usr/bin:/usr/sbin +if [ ! -d $workPath ]; then + mkdir $workPath -p +fi + function uploadLog() { ctype=$1 diff --git a/frontEndUpgrade.sh b/frontEndUpgrade.sh index 928f0ea..10e1988 100755 --- a/frontEndUpgrade.sh +++ b/frontEndUpgrade.sh @@ -12,10 +12,14 @@ if [ -n $5 ]; then user=$5 fi +if [ ! -d $workPath ]; then + mkdir $workPath -p +fi + PATH=PATH:/usr/bin:/usr/sbin projectName="${fileName%.*}" # html, zhuize preName="${fileName%.*}" - +! function uploadLog() { ctype=$1 diff --git a/ossUpgrade.sh b/ossUpgrade.sh index cc9a8b4..90703db 100755 --- a/ossUpgrade.sh +++ b/ossUpgrade.sh @@ -11,6 +11,9 @@ basePath=/tmp/autoDeploy if [ -n $3 ]; then basePath=$3 fi +if [ ! -d $basePath ]; then + mkdir $basePath -p +fi function compare(){ cd $basePath