-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·56 lines (47 loc) · 877 Bytes
/
build.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
#!/bin/bash
param=$1;
repository="";
remote="origin";
do_commit(){
git add .
echo "Message du commit"
read commitMessage
git commit -m "${commitMessage}"
}
do_make(){
make all
}
do_push(){
echo "Which branch to push"
read localBranch
git push -u "${remote}" "${localBranch}"
}
do_make_and_commit(){
make all
mv *.o
mv main
git add .
echo "Message du commit"
read commitMessage
git commit -m "${commitMessage}"
}
do_init(){
echo "Set a repository url : "
read repositoryURL
echo "Set a remote name"
read remoteBranch
remote=${remoteBranch}
repository=${repositoryURL}
git remote add "${remoteBranch}" "${repositoryURL}"
}
if [[ $1 = "-make_commit" ]]; then
do_make_and_commit
elif [[ $1 = "-push" ]]; then
do_push
elif [[ $1 = "-make" ]]; then
do_make
elif [[ $1 = "-commit" ]]; then
do_commit
elif [[ $1 = "-init" ]]; then
do_init
fi