-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·60 lines (53 loc) · 1.27 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
echo "
--------------------------------------------------------------------------
Project Name: Blog Webiste
Author: Abdul Rafay
GitHub Repo: https://github.com/rafay99-epic/Blog-website
Website URL: https://tech-machine.tech
Operating System: Arch Linux
------------------------------------------------------------------------
"
# This function will check status && will add all of the files
function git_status()
{
git status
git add *
}
function git_commit()
{
echo "
----------------------------------------
Enter your Commit Message:
----------------------------------------
"
read message
git commit -m "$message"
}
# This is the Push function
function git_push()
{
git push
}
function main()
{
branch="git branch --show-current"
if [[ $branch == "main" ]];then
echo "
---------------------------------------
You are on the main Branch
So Code is commited to the main branch
--------------------------------------"
git pull
else
echo "
-----------------------------
You are on $branch
-----------------------------"
git_status
git_commit
git_push
fi
}
#This is the running Point
main