Last active
July 18, 2019 19:03
-
-
Save FreeWall/21a32a096b6dc1c8b1a5e152348b86e0 to your computer and use it in GitHub Desktop.
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 | |
# exit when any command fails | |
set -e | |
COLOR_GREEN="\033[0;32m" | |
DEVELOPER=$(whoami) | |
cd "/var/www/$DEVELOPER.tmp123.cz/web/" | |
clear | |
echo "Updating repository starts ..." | |
if [ -L media/catalog ] | |
then | |
unlink media/catalog | |
fi | |
git fetch | |
git reset --hard | |
branch=$1 | |
if [ -n "$branch" ] | |
then | |
git checkout $branch | |
else | |
git checkout master | |
fi | |
git checkout -- . | |
git clean -fd . | |
git pull | |
rm -rf media/catalog | |
ln -s $(pwd)/../../vyvojar1.tmp123.cz/web/media/catalog media/catalog | |
git status | |
echo -e "$COLOR_GREEN" | |
echo "DONE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment