From cd8fff39c064f49e69884f752610eabcc3769ef8 Mon Sep 17 00:00:00 2001 From: Noa3 <noa3@gmx.net> Date: Tue, 22 Oct 2024 09:42:44 +0200 Subject: [PATCH] reupload of the updater files --- updater.bat | 43 +++++++++++++++++++++++++++++++++++++++++++ updater.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 updater.bat create mode 100644 updater.sh diff --git a/updater.bat b/updater.bat new file mode 100644 index 00000000000..b7fdacef608 --- /dev/null +++ b/updater.bat @@ -0,0 +1,43 @@ +@echo off + +REM Echo the steps the script will perform +echo This script will: +echo 1. Check if dependencies are installed. +echo 2. Pull the latest changes from the specified remote repository. +echo 3. If the .git folder is not found, clone the repository from the specified URL. (https://gitgud.io/pregmodfan/fc-pregmod.git) + +REM Get the directory where the batch file is located (repository directory) +set SCRIPT_DIR=%~dp0 + +REM Set the URL to clone the repository +set REPO_URL=https://gitgud.io/pregmodfan/fc-pregmod.git + +REM Ask if we should proceed with the Git installation check +set /p PROCEED="Do you want to proceed? (y/n): " +if /I "%PROCEED%" neq "y" ( + echo Operation aborted. + exit /B 0 +) + +:: run dependencyCheck.bat +CALL .\devTools\scripts\dependencyCheck.bat +SET CODE=%ERRORLEVEL% + +IF %CODE% EQU 0 ( + REM Ensure we are inside the Git repository + if exist ".git" ( + echo Pulling the latest changes from the specified remote repository... + git pull origin + ) else ( + echo .git folder not found. Cloning the repository... + + REM Initialize a new Git repository and set the origin + git init + git remote add origin %REPO_URL% + git pull origin pregmod-master + ) + echo Update complete! +) + +@echo Exit +pause \ No newline at end of file diff --git a/updater.sh b/updater.sh new file mode 100644 index 00000000000..bafc83c28ab --- /dev/null +++ b/updater.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Echo the steps the script will perform +echo "This script will:" +echo "1. Check if dependencies are installed." +echo "2. Pull the latest changes from the specified remote repository." +echo "3. If the .git folder is not found, clone the repository from the specified URL. (https://gitgud.io/pregmodfan/fc-pregmod.git)" + +# Set the URL to clone the repository +REPO_URL=https://gitgud.io/pregmodfan/fc-pregmod.git + +# Ask if we should proceed with the Git installation check +read -p "Do you want to proceed? (y/n): " PROCEED +if [[ ! "$PROCEED" =~ ^[Yy]$ ]]; then + echo "Operation aborted." + exit 0 +fi + +# Run dependencyCheck.sh +./devTools/scripts/dependencyCheck.sh +CODE=$? + +if [ $CODE -eq 0 ]; then + # Ensure we are inside the Git repository + if [ -d ".git" ]; then + echo "Pulling the latest changes from the specified remote repository..." + git pull origin + else + echo ".git folder not found. Cloning the repository..." + + # Initialize a new Git repository and set the origin + git init + git remote add origin $REPO_URL + git pull origin pregmod-master + fi + echo "Update complete!" +fi \ No newline at end of file -- GitLab