-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpull.sh
executable file
·48 lines (40 loc) · 1.11 KB
/
pull.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
#!/bin/sh
if [ -z "$GOPATH" ]; then
echo "Need to set GOPATH"
exit 1
fi
if [[ -d "peerbackend" ]]; then
read -p "Peerbackend already exists. Delete and re-pull code? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf peerbackend
else
exit
fi
fi
# Folder Variables
WS=`pwd`
GOTMP=$GOPATH/src/tmp/peerbackend
echo "------------------------------------------------------------"
echo "Pull code from Github"
echo "------------------------------------------------------------"
if ! git clone --depth 1 https://github.com/turbotardigrade/agora.git $GOTMP; then
echo "Could not clone project"
exit
fi
echo "------------------------------------------------------------"
echo "Install dependencies"
echo "------------------------------------------------------------"
cd $GOTMP
go get
gx install
echo "------------------------------------------------------------"
echo "Build Peerbackend"
echo "------------------------------------------------------------"
mv $GOTMP $WS
cd $WS/peerbackend
if ./travis_install.sh && go build ; then
echo "Build succeeded"
else
echo "Build failed"
fi