forked from vietdungdev/Koolo-DiobyteVersion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdater.bat
More file actions
74 lines (60 loc) · 1.5 KB
/
Copy pathUpdater.bat
File metadata and controls
74 lines (60 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
setlocal enabledelayedexpansion
:: Set current directory to script location
cd /d "%~dp0"
echo -----------------------------------
echo [0/2] Checking Requirements...
echo -----------------------------------
where git >nul 2>nul
if errorlevel 1 (
echo ERROR: Git is not installed.
pause
exit /b
)
echo Git is installed.
echo.
echo -----------------------------------
echo [1/2] Updating Repository...
echo -----------------------------------
git checkout main
git restore .
git pull origin main
if errorlevel 1 (
echo.
echo ERROR: Git pull failed.
pause
exit /b
)
echo.
echo -----------------------------------
echo Managing Old Executables...
echo -----------------------------------
:: Define paths
set "BUILD_DIR=%~dp0build"
set "OLD_DIR=%BUILD_DIR%\old_versions"
if exist "%BUILD_DIR%\*.exe" (
if not exist "%OLD_DIR%" (
echo Creating directory: %OLD_DIR%
mkdir "%OLD_DIR%"
)
echo Moving old .exe to old_versions folder...
move /y "%BUILD_DIR%\*.exe" "%OLD_DIR%\"
) else (
echo No old .exe found in build folder. Skipping move.
)
echo.
echo -----------------------------------
echo [2/2] Starting better_build.bat...
echo (Auto-answering "n" to config prompt)
echo -----------------------------------
if not exist "better_build.bat" (
echo ERROR: better_build.bat not found!
pause
exit /b
)
(echo n) | call better_build.bat
echo.
echo -----------------------------------
echo Update, Move, and Build process complete!
echo.
pause