Skip to content

Commit 2352b1b

Browse files
committed
Add files via upload
1 parent 465ba5e commit 2352b1b

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

deploy.sh

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ npm_run_build() {
3737
}
3838

3939
#==================================================================================================
40-
# commit && push
40+
# git commit
4141
#==================================================================================================
42-
commit_push() {
42+
git_commit() {
4343
while true; do
4444
printf "\n"
4545
read -p "${BOLD}commit? (Y/n)${RESET}" yn
@@ -57,7 +57,6 @@ commit_push() {
5757
printf "\n"
5858
git add .
5959
git commit -m "$commitmsg"
60-
git push
6160
break;;
6261

6362
[Nn]* ) return 0;;
@@ -66,32 +65,29 @@ commit_push() {
6665
done
6766
}
6867

68+
#==================================================================================================
69+
# git push
70+
#==================================================================================================
71+
git_push() {
72+
while true; do
73+
printf "\n"
74+
read -p "${BOLD}git push? (Y/n)${RESET}" yn
75+
case ${yn} in
76+
[Yy]* ) git push; break;;
77+
[Nn]* ) return 0;;
78+
* ) echo "Please answer yes or no.";;
79+
esac
80+
done
81+
}
82+
6983
#==================================================================================================
7084
# main
7185
#==================================================================================================
7286
main() {
7387
npm_run_dev
7488
npm_run_build
75-
commit_push
89+
git_commit
90+
git_push
7691
}
7792

7893
main
79-
80-
81-
# get commit message
82-
printf "\n"
83-
# IFS= read -r -p "${BOLD}Enter commit message: ${RESET}" commitmsg
84-
85-
# if commitmsg empty
86-
# if [ -z "$commitmsg" ]
87-
# then
88-
# echo "${BOLD}Commit message is empty${RESET}"
89-
# commitmsg="Add files via upload"
90-
# fi
91-
92-
# printf "\n"
93-
# git add .
94-
# git commit -m "$commitmsg"
95-
# git push
96-
97-
# exit

0 commit comments

Comments
 (0)