#!/bin/sh if [ "$1" = "test" ]; then branch='test' location='/var/www/html-test' elif [ "$1" = "prod" ]; then branch='main' location='/var/www/html' fi rm -rf "$HOME/public_html" cd ~/website || exit git checkout "$branch" git clean -f git pull cd ~/dotfiles || exit git checkout "$branch" git clean -f git pull cd ~/blog || exit git checkout "$branch" git clean -f git pull cd ~/dotfiles || exit ~/website/fix-dotfile-paths.sh emacs --batch -f package-initialize --script ~/website/publish.el ~/website/post-publish.sh /bin/cp -r "$HOME/public_html"/* "$location" chown -R apache:apache "$location"