Skip to content

Commit 651ccbf

Browse files
committed
update preview & push command
1 parent d0cfd4f commit 651ccbf

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed
-25.6 KB
Loading

push.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
#!/bin/bash
22

33
echo '';
4+
echo " a. development";
5+
echo " b. master";
6+
echo -n "[+] branch [a/B] ➜ ";
7+
read branch;
8+
49
echo -n "[+] commit ➜ ";
510
read commit;
611

7-
if [ "$commit" ]; then
8-
git add .;
9-
git commit -m "$commit";
10-
git push -u origin master;
12+
if [ "$commit" ] && [ "$branch" ]; then
13+
git add .;
14+
git commit -m "$commit";
15+
16+
if [ "$branch" == 'b' ] || [ "$branch" == 'B' ]; then
17+
git checkout master;
18+
git push origin master;
19+
else
20+
git checkout development;
21+
git push origin development;
22+
fi
23+
24+
echo "[i] successfully pushed at" $(date);
25+
else
26+
echo "[!] not pushed!";
1127
fi

0 commit comments

Comments
 (0)