Last active
October 31, 2017 01:02
-
-
Save nodesocket/15dba9ebbcc9e119cc3a to your computer and use it in GitHub Desktop.
This file contains 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
BASE_PATH="/srv/www" | |
REPO_PATH="/srv/www/repo" | |
GIT_URL="https://github.com/username/repo.git" | |
if [ -d "$REPO_PATH" ]; then | |
cd $REPO_PATH || exit 3 | |
git pull --quiet | |
echo "git pull successfully ran ($(git rev-parse --short HEAD))"; | |
else | |
cd $BASE_PATH || exit 3 | |
git clone $GIT_URL --quiet | |
echo "git clone successfully ran" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment