Skip to content

Commit c8382b5

Browse files
committed
🆕 Added a script version check
1 parent 6e292a9 commit c8382b5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

START.bat

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
title Checking dependencies...
3-
set scriptversion=0.1
3+
set scriptversion=1.1.0
44

55
REM Set restart counter variables
66
set "restartCount=0"
@@ -23,6 +23,19 @@ if not exist .\config\StartupScript.conf (
2323

2424
:initiateServer
2525
title Initiating server...
26+
27+
REM Check for updates to this script.
28+
for /f "delims=" %%a in ('powershell -Command "(Invoke-WebRequest -Uri 'https://api.github.com/repos/GarnServo/mc-startup-script/releases/latest').Content | ConvertFrom-Json | Select -ExpandProperty tag_name"') do set latestVersion=%%a
29+
echo Current script version: %scriptVersion%
30+
echo Latest version from GitHub: %latestVersion%
31+
REM Check if the script version is greater than the latest version
32+
if "%latestVersion%" LSS "v%scriptVersion%" (
33+
echo You have the latest version of the script.
34+
) else (
35+
echo An update is available for the script ^(version "%latest_version%"^). Please visit the GitHub page for more details:
36+
echo https://github.com/GarnServo/mc-startup-script/releases/latest
37+
)
38+
2639
REM Check EULA exists, if not, go to create it (and accept it)
2740
if not exist "eula.txt" (
2841
goto eula

0 commit comments

Comments
 (0)