-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·49 lines (39 loc) · 1.15 KB
/
install
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
#!/usr/bin/env bash
set -e
base="$HOME"/.p9p
install_darwin()
{
# Copy Plumb.app acme.app and 9term.app to /Applications
for i in "$PLAN9"/mac/Plumb.app $base/mac/9term.app $base/mac/Acme.app $base/mac/Sam.app; do
if [ ! -d /Applications/"$(basename "$i")" ]; then
echo "Installing $i in /Applications/$(basename "$i")"
cp -r "$i" /Applications/
else
echo "/Applications/$(basename "$i") already exists.. skipping"
fi
done
}
install_devdrawserver()
{
[ ! -d "$base"/cmd/devdrawserver ] && {
cd "$base"/cmd/
git clone https://github.com/mariusae/devdrawserver.git
}
[ ! -x "$PLAN9"/bin/devdrawserver ] && {
cd "$base"/cmd/devdrawserver && git pull && mk install && mk clean
}|| echo "devdrawserver is already installed in: $PLAN9/bin/devdrawserver"
}
if [ ! -d "$base" ]; then
echo "$base not found or doesn't exist, please set \$base in $0 to the correct path"
exit 2
fi
if [ "$(uname -s)" = "Darwin" ]; then
install_darwin
fi
# Install devdrawserver
# install_devdrawserver
[ ! -x "$base"/bin/acmedot ] && {
cd "$base"/cmd/acmedot
go build && mv acmedot "$base"/bin/
} || echo "acmedot already installed in: $base/bin/acmedot"
cd "$base"