-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate.bat
More file actions
37 lines (30 loc) · 748 Bytes
/
update.bat
File metadata and controls
37 lines (30 loc) · 748 Bytes
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
@ECHO OFF
setlocal EnableDelayedExpansion
cd /D "%~dp0"
echo Performing git update...
REM Check if we need to use origin/main instead of github/main
git remote -v | findstr "github" >nul
if %ERRORLEVEL% NEQ 0 (
echo Using origin/main
git fetch --all
git reset --hard origin/main
) else (
echo Using github/main
git fetch --all
git reset --hard github/main
)
REM Check if git operations succeeded
if %ERRORLEVEL% NEQ 0 (
echo Git update failed
exit /b 1
)
echo Git update completed successfully
REM Run npm install to update dependencies
echo Running npm install...
npm install
if %ERRORLEVEL% NEQ 0 (
echo npm install failed but continuing
exit /b 2
)
echo Dependencies updated successfully
exit /b 0