#!/bin/bash
_get_repolink () {
local regex
regex='(https?)://github.com/.+/.+'
if [[ $ARRAY_REPO == "ArrayCore" ]]
then
echo "aHR0cHM6Ly9naXRodWIuY29tL1RoZS1IZWxsQm90L0FycmF5Q29yZS9hcmNoaXZlL21haW4uemlw" | base64 -d
elif [[ $ARRAY_REPO == "ArrayCore" ]]
then
echo "aHR0cHM6Ly9naXRodWIuY29tL1RoZS1IZWxsQm90L0FycmF5Q29yZS9hcmNoaXZlL21haW4uemlw" | base64 -d
elif [[ $ARRAY_REPO =~ $regex ]]
then
if [[ $ARRAY_REPO_BRANCH ]]
then
echo "${ARRAY_REPO}/archive/${ARRAY_REPO_BRANCH}.zip"
else
echo "${ARRAY_REPO}/archive/main.zip"
fi
else
echo "aHR0cHM6Ly9naXRodWIuY29tL1RoZS1IZWxsQm90L0FycmF5Q29yZS9hcmNoaXZlL21haW4uemlw" | base64 -d
fi
}
_set_bot () {
local zippath
zippath="ArrayCore.zip"
echo "• Downloading Data •"
wget -q $(_get_repolink) -O "$zippath"
arraypath=$(zipinfo -1 "$zippath" | grep -v "/.");
unzip -qq "$zippath"
echo "• Done •"
rm -rf "$zippath"
sleep 5
cd $arraypath
echo "••• Starting ArrayCore ••• "
python3 ../setup/updater.py ../requirements.txt requirements.txt
python3 -m ArrayCore
}
_set_bot