You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy.sh
+18-12Lines changed: 18 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -121,19 +121,25 @@ function doRunCommand() {
121
121
# check preconditions
122
122
if [ "$DEPLOY_UPDATESITE"="stable" ] && [ -d"../gh-pages" ]
123
123
then
124
-
cd ../gh-pages
125
-
CHANGE_LIST=$(git diff --shortstat && git status --porcelain)
126
-
if [ !-z"$CHANGE_LIST" ]
127
-
then
128
-
echo"../gh-pages is not clean"
129
-
doAskQuestion "Should I cleanup?"# will exit if no
130
-
doRunCommand "git reset --hard HEAD"
131
-
doRunCommand "git clean -xf"
132
-
doRunCommand "git pull"
133
-
fi
134
-
cd"$SCRIPT_PATH"
124
+
cd ../gh-pages
125
+
if [[ $(git diff --shortstat && git status --porcelain) ]]
126
+
then
127
+
echo"../gh-pages is prepared"
128
+
else
129
+
echo"../gh-pages is not clean"
130
+
doAskQuestion "Should I cleanup?"# will exit if no
131
+
doRunCommand "git reset --hard HEAD"
132
+
doRunCommand "git clean -xf"
133
+
doRunCommand "git pull"
134
+
fi
135
+
cd"$SCRIPT_PATH"
135
136
else
136
-
echo"Not detected cloned gh-pages branch in ../gh-pages folder."
137
+
echo"Not detected cloned gh-pages branch in ../gh-pages folder."
138
+
ORIGIN="$(git config --get remote.origin.url)"
139
+
case"$ORIGIN"in
140
+
*devonfw/cobigen*) doAskQuestion "Should I clone gh-pages from $ORIGIN"&&echo"Cloning from $ORIGIN into ../gh-pages ..."&& git clone --branch gh-pages $ORIGIN ../gh-pages ;;
141
+
*) echo"You are working on a fork, please make sure, you are releasing from devonfw/cobigen#master"&&exit 1 ;;
0 commit comments