-
-
Save okomestudio/a61c11ec8f68d7f15695 to your computer and use it in GitHub Desktop.
W.E. Bridge Phabricator Arcanist (arc) Setup script for Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo -e "Missing 1 parameter: Phabricator URL." | |
echo -e "ex: arc_setup.sh https://phabricator.mycompany.com" | |
fi | |
if ! hash git &> /dev/null || ! hash php &> /dev/null; then | |
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****" | |
sudo apt-get install git-core php5-cli php5-curl | |
fi | |
if [ ! -d ~/.arc_install ]; then | |
echo -e " *****\n ***** CLONING THE ARC TOOL\n *****" | |
mkdir ~/.arc_install | |
git clone https://github.com/phacility/libphutil.git ~/.arc_install/libphutil | |
git clone https://github.com/phacility/arcanist.git ~/.arc_install/arcanist | |
else | |
echo -e " *****\n ***** UPDATING ARC\n *****" | |
pushd ~/.arc_install/libphutil/ > /dev/null | |
git pull | |
cd ~/.arc_install/arcanist/ | |
git pull | |
popd > /dev/null | |
fi | |
if [ ! -f ~/.arcrc ]; then | |
~/.arc_install/arcanist/bin/arc set-config default $1 | |
~/.arc_install/arcanist/bin/arc install-certificate | |
fi | |
if ! hash arc &> /dev/null; then | |
echo -e "\n******************************************************\n" | |
echo " You need to add \"~/.arc_install/arcanist/bin\" to your PATH variable" | |
echo " For example you can add in your ~/.bashrc:" | |
echo " export PATH=\"$PATH:~/.arc_install/arcanist/bin\"" | |
echo -e "\n******************************************************" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment