Update unreal script to only pull the repo if it doesn't exist on the system

This commit is contained in:
Rodolfo Barcelli Jo 2024-07-11 13:10:03 +08:00
parent 8391e1df79
commit cc96645899

View file

@ -11,8 +11,10 @@ read -p "Enter your github token: " token
while true; do
read -p "What release of Unreal Would you like? (Please check the Unreal repository for release numbers): " answer
cd $software_PATH
if [[ ! -d $software_PATH/UnrealEngine ]]; then
git clone https://github.com/EpicGames/UnrealEngine "UnrealEngine$answer"
cd "UnrealEngine$answer"
fi
cd "$software_PATH/UnrealEngine$answer"
git checkout "$answer-release"
bash Setup.sh
bash GenerateProjectFiles.sh
@ -36,7 +38,9 @@ Categories=Development;Animation;
if [[ ! -d /home/$(whoami)/.local/share/applications ]]; then
mkdir /home/$(whoami)/.local/share/applications
fi
ln -s "$software_PATH/UnrealEngine$answer/UnrealEngine$answer.desktop" ".local/share/applications/"
while true; do
read -p "Do you want to install another version? (y/n) " response
if [[ "${response,,}" == "n" ]]; then
@ -47,9 +51,11 @@ Categories=Development;Animation;
"Invalid Response (y/n)"
fi
done
if [[ "${response,,}" == "y" ]]; then
echo -n ""
else
break
fi
done