-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush
More file actions
executable file
·61 lines (54 loc) · 1.27 KB
/
push
File metadata and controls
executable file
·61 lines (54 loc) · 1.27 KB
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
61
#!/bin/bash
sync_home() {
local msg="$1"
git -C "$HOME" add .
if [ -n "$msg" ]; then
git -C "$HOME" commit -m "$msg"
else
git -C "$HOME" commit
fi
git -C "$HOME" push
}
sync_arch(){
git -C $HOME/arch add .
git -C $HOME/arch commit -am "updating arch module" > /dev/null
git -C $HOME/arch push
}
sync_bill(){}
sync_task(){}
# Check the number of arguments
if [ "$#" -eq 0 ]; then
sync_home
elif [ "$#" -ge 2 ]; then
echo "Usage: $0 <option>"
echo "Options: task, bill, arch"
exit 1
fi
# Check the argument and perform actions accordingly
case "$1" in
*task*)
git -C ~/.task add .
git -C ~/.task commit -am "updating task module" > /dev/null
git -C ~/.task push
git -C $HOME add .task
git -C $HOME commit -am "updating task module"
git -C $HOME push
exit 0
;;
*bill*)
git -C ~/.bills add .
git -C ~/.bills commit -am "updating bill module" > /dev/null
git -C ~/.bills push
#TODO ******************************
exit 0
;;
*arch*)
sync_arch
exit 0
;;
*)
echo "Invalid option: $1"
echo "Available options: task, bill, arch"
exit 1
;;
esac