-
Notifications
You must be signed in to change notification settings - Fork 13
/
installarcanist.sh
executable file
·55 lines (44 loc) · 1.37 KB
/
installarcanist.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
49
50
51
52
53
54
55
#!/bin/bash
set -e
# Downloads arcanist, etc and configures your system
LOC_DIR="/usr/local"
BIN_DIR="$LOC_DIR/bin"
PHP_DIR="$LOC_DIR/include/php"
if [ ! -w "$LOC_DIR" ]; then
if [ -z "$SUDO_USER" ]; then
echo "Re-running installation with sudo (no permission on $LOC_DIR for current user)."
exec sudo /bin/sh $0 $*
else
echo "We can't seem to access ${LOC_DIR}. Please check permissions on this folder and try again."
exit -1
fi;
fi;
if [ ! -e "$PHP_DIR" ]; then
mkdir -p $PHP_DIR
fi;
# Install or update libphutil
echo "Updating arcanist.."
if [ -e "$PHP_DIR/arcanist" ]; then
arc upgrade
else
git clone https://secure.phabricator.com/diffusion/ARC/arcanist.git "$PHP_DIR/arcanist"
fi
# Install or update libdisqus
echo "Updating libdisqus.."
if [ -e "$PHP_DIR/libdisqus" ]; then
cd "$PHP_DIR/libdisqus" && git pull origin master
else
git clone https://github.com/disqus/disqus-arcanist.git "$PHP_DIR/libdisqus"
fi
# Register arc commands
echo "Registering arc commands.."
## create-arcconfig
ln -fs "$PHP_DIR/libdisqus/bin/create-arcconfig" "$BIN_DIR/create-arcconfig"
chmod +x "$BIN_DIR/create-arcconfig"
## update-arcanist
ln -fs "$PHP_DIR/libdisqus/bin/update-arcanist" "$BIN_DIR/update-arcanist"
chmod +x "$BIN_DIR/update-arcanist"
## arc
ln -fs "$PHP_DIR/arcanist/bin/arc" "$BIN_DIR/arc"
chmod +x "$BIN_DIR/arc"
echo "Done!"