-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_pp.bash
executable file
·69 lines (53 loc) · 1.38 KB
/
do_pp.bash
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
62
63
64
65
66
67
68
69
#! /bin/bash
function back () {
if [[ $1 == "b/" ]];then
exit 88
fi
return
}
function do_pp () {
local cond
local noprev=0
read -p "project name : "
back $REPLY
cd ${IDKDIR}/gitprocess/gitprocessof$REPLY 2>/dev/null
while [[ $? -eq 1 && $REPLY != "all" ]]
do
echo "no such project "
read -p "project name: "
back $REPLY
cd ${IDKDIR}/gitprocess/gitprocessof$REPLY 2>/dev/null
done
echo "start ${mode}ing $REPLY"
if [[ "$REPLY" == 'all' ]]; then
for i in $(cd ${IDKDIR}/gitprocess/; find . -name 'gitprocessof*'| sed -e 's/^..//' -e 's/gitprocessof//' -e 's/.bash//p')
do
cd ${IDKDIR}
chmod +x ./pp.bash
./pp.bash ${mode} $i "auto"
cond=$?
if [[ $cond -eq 0 ]];then
echo "$i ${mode} successed"
else
echo "$i ${mode} failed"
fi
done
else
cd ${IDKDIR}
chmod +x ./pp.bash
source ./pp.bash ${mode} $REPLY "normal" #bash -x
cond=$?
if [[ $cond -eq 0 ]];then
echo "$REPLY ${mode} successed"
else
echo "$REPLY ${mode} failed"
fi
fi
return
}
if [[ $1 == "push" ]];then
mode="push"
else
mode="pull"
fi
do_pp