Files
azerothcore_installer/2_source-update.sh
2024-07-29 18:17:04 +00:00

48 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
ROOT_DIR="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
source ${ROOT_DIR}/variables.sh
read -p "This will update the source code. Are you sure? (Y)es/(N)o: " -n 1 -r
echo " ";
if [[ $REPLY =~ ^[Yy]$ ]];
then
sudo chmod +x ${ROOT_DIR}/*.sh
sudo chmod +x ${ROOT_DIR}/helper/*.sh
##########################################################################################
# General dependencies
##########################################################################################
sudo apt update && sudo apt install -y git
##########################################################################################
# reset azerothcore to latest branch
##########################################################################################
git -C ${ROOT_DIR}/_download/azerothcore fetch origin
git -C ${ROOT_DIR}/_download/azerothcore clean -fd
git -C ${ROOT_DIR}/_download/azerothcore reset --hard origin/Playerbot
##########################################################################################
# reset mod-playerbots to latest branch
##########################################################################################
git -C ${ROOT_DIR}/_download/modules/mod-playerbots fetch origin
git -C ${ROOT_DIR}/_download/modules/mod-playerbots clean -fd
git -C ${ROOT_DIR}/_download/modules/mod-playerbots reset --hard origin/master
##########################################################################################
# reset mod-ah-bot to latest branch
##########################################################################################
git -C ${ROOT_DIR}/_download/modules/mod-ah-bot fetch origin
git -C ${ROOT_DIR}/_download/modules/mod-ah-bot clean -fd
git -C ${ROOT_DIR}/_download/modules/mod-ah-bot reset --hard origin/master
echo "Executed..."
fi