From 05085d4594461137c2f3f3e57c138427b3892729 Mon Sep 17 00:00:00 2001 From: Jason Hawks Date: Tue, 25 Jul 2017 09:15:18 -0400 Subject: [PATCH] added map config in setup.sh --- setup.sh | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index efb2dc14f9..869d1b45e8 100755 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash #encoding=utf8 pokebotpath=$(cd "$(dirname "$0")"; pwd) +webpath=$pokebotpath"/web" backuppath=$pokebotpath"/backup" function Pokebotupdate () { @@ -64,13 +65,31 @@ cp configs/$cfgoption configs/config.json echo "Edit ./configs/config.json to modify any other config." } +function Webconfig () { +cd $webpath +if [ -f config/userdata.js.example ]; then +echo " +----------------- +Configure userdata.js for web +----------------- +" +read -p "Input E-Mail (Google) or Username (PTC) +" webusername +read -p "Input Google API Key (gmapkey) +" webgmapkey +sed -e "s/username1/$webusername/g" -e "s/YOUR_API_KEY_HERE/$webgmapkey/g" \ + config/userdata.js.example > config/userdata.js +echo "Your userdata.js is now configured." +else +echo "You do not yet have the web files installed. Please first run 'setup.sh -i' to install all the files." +fi +} + function Pokebotinstall () { cd $pokebotpath if [ "$(uname -s)" == "Darwin" ] then -echo "You are on Mac OS" -brew update -#brew install --devel protobuf +echo "You are on macOS" elif [ $(uname -s) == CYGWIN* ] then echo "You are on Cygwin" @@ -124,9 +143,11 @@ easy_install virtualenv fi Pokebotreset Pokebotupdate -echo "Install complete. Starting to generate auth.json and config.json." +echo "Install complete. Starting to generate auth.json and config.json and userdata.js for web." Pokebotauth Pokebotconfig +Webconfig +echo "You can now use the bot by executing 'run.sh'. You may also start the web tracker by executing 'web.sh'." } function Pokebotreset () { @@ -135,6 +156,7 @@ git fetch -a if [ "1" == $(git branch -vv |grep -c "* dev") ] then echo "Branch dev resetting." + git reset --hard origin/dev elif [ "1" == $(git branch -vv |grep -c "* master") ] then @@ -156,6 +178,7 @@ echo " -i,--install. Install PokemonGo-Bot." echo " -b,--backup. Backup config files." echo " -a,--auth. Easy auth generator." echo " -c,--config. Easy config generator." +echo " -w,--web. Web config generator." echo " -r,--reset. Force sync source branch." echo " -u,--update. Command git pull to update." } @@ -185,6 +208,9 @@ Pokebotauth --config|-c) Pokebotconfig ;; +--web|-w) +Webconfig +;; --help|-h) Pokebothelp ;;