File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,22 @@ echo "Deploying..."
46
46
echo " Source branch: $SRC_BRANCH "
47
47
echo " Deploy branch: $DEPLOY_BRANCH "
48
48
49
+ read -r -p " Do you want to proceed? [y/N] " response
50
+ if [[ ! $response =~ ^([yY][eE][sS]| [yY])+$ ]]
51
+ then
52
+ echo " Aborting."
53
+ [[ " $0 " = " $BASH_SOURCE " ]] && exit 1 || return 1
54
+ fi
55
+
56
+ # Check if there are any uncommitted changes
57
+ if ! git diff-index --quiet HEAD --; then
58
+ echo " Changes to the following files are uncommitted:"
59
+ git diff-index --name-only HEAD --
60
+ echo " Please commit the changes before proceeding."
61
+ echo " Aborting."
62
+ [[ " $0 " = " $BASH_SOURCE " ]] && exit 1 || return 1
63
+ fi
64
+
49
65
# Switch to source branch (creates it if necessary from the current branch)
50
66
if [ ` git branch | grep $SRC_BRANCH | tr ' ' ' \n' | tail -1` ]
51
67
then
You can’t perform that action at this time.
0 commit comments