File tree Expand file tree Collapse file tree 1 file changed +19
-23
lines changed Expand file tree Collapse file tree 1 file changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ npm_run_build() {
37
37
}
38
38
39
39
# ==================================================================================================
40
- # commit && push
40
+ # git commit
41
41
# ==================================================================================================
42
- commit_push () {
42
+ git_commit () {
43
43
while true ; do
44
44
printf " \n"
45
45
read -p " ${BOLD} commit? (Y/n)${RESET} " yn
@@ -57,7 +57,6 @@ commit_push() {
57
57
printf " \n"
58
58
git add .
59
59
git commit -m " $commitmsg "
60
- git push
61
60
break ;;
62
61
63
62
[Nn]* ) return 0;;
@@ -66,32 +65,29 @@ commit_push() {
66
65
done
67
66
}
68
67
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
+
69
83
# ==================================================================================================
70
84
# main
71
85
# ==================================================================================================
72
86
main () {
73
87
npm_run_dev
74
88
npm_run_build
75
- commit_push
89
+ git_commit
90
+ git_push
76
91
}
77
92
78
93
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
You can’t perform that action at this time.
0 commit comments