-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
44 lines (32 loc) · 760 Bytes
/
install.sh
File metadata and controls
44 lines (32 loc) · 760 Bytes
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
#!/usr/bin/env bash
INSTALL_BASE_URL="https://raw.githubusercontent.com/freenowtech/protoc-wrapper/master"
print() {
printf "$1" >&2
}
println() {
echo "$1" >&2
}
print "Downloading Protoc Wrapper... "
curl -fsSL "$INSTALL_BASE_URL/protocw" -o protocw.new
last_error=$?
if [ $last_error -ne 0 ]; then
println "Error"
println "Could not download Protoc Wrapper from $INSTALL_BASE_URL"
exit $last_error
fi
println "Done"
println "Moving stuff around"
if [ -f protocw ]
then
mv -f protocw protocw.old
fi
mv protocw.new protocw
println "Setting permissions"
chmod +x protocw
println "Cleaning up"
rm -f protocw.old
if [ ! -f protocw.properties ]
then
./protocw --configure
fi
println "Protoc Wrapper successfully installed"