Skip to content

Instantly share code, notes, and snippets.

@okomestudio
Forked from thomas-barthelemy/arc_setup.sh
Created February 9, 2016 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okomestudio/a61c11ec8f68d7f15695 to your computer and use it in GitHub Desktop.
Save okomestudio/a61c11ec8f68d7f15695 to your computer and use it in GitHub Desktop.
W.E. Bridge Phabricator Arcanist (arc) Setup script for Ubuntu
#!/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