From f04f15f7675341eca72edbbf2cf939e20a89eb3d Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Fri, 28 Jun 2019 10:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=97=B6,=E5=8F=AF=E4=BB=A5=E6=8C=89=20y=20=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy-gh-pages.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deploy-gh-pages.sh b/deploy-gh-pages.sh index 6552a3c6..10d0f92c 100755 --- a/deploy-gh-pages.sh +++ b/deploy-gh-pages.sh @@ -6,8 +6,13 @@ if [ -z "$(git status --porcelain)" ]; then echo "Working directory clean" else # Uncommitted changes - echo "Skiped: You got uncommitted changes" - exit + read -p "You got uncommitted changes, press y to continue? " -n 1 -r + echo # (optional) move to a new line + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + echo "Skiped!" + [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell + fi fi rm -rf gh-pages