-
Notifications
You must be signed in to change notification settings - Fork 383
Expand file tree
/
Copy pathupdate.bat
More file actions
128 lines (113 loc) · 3.31 KB
/
Copy pathupdate.bat
File metadata and controls
128 lines (113 loc) · 3.31 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@echo off
setlocal EnableExtensions
chcp 65001 >nul
title VCPToolBox Global Updater
REM Always run from the repository root where this script is located.
cd /d "%~dp0" || goto :fail_directory
echo ============================================================
echo VCPToolBox Global Updater
echo ============================================================
echo.
call :check_command git "Git"
if errorlevel 1 goto :fail
call :check_command node "Node.js"
if errorlevel 1 goto :fail
call :check_command npm "npm"
if errorlevel 1 goto :fail
call :check_command cargo "Rust Cargo"
if errorlevel 1 goto :fail
call :check_command rustc "Rust compiler"
if errorlevel 1 goto :fail
git rev-parse --is-inside-work-tree >nul 2>&1
if errorlevel 1 (
echo [ERROR] This script is not running inside a Git repository.
goto :fail
)
echo [1/6] Pulling latest source code with fast-forward only...
git pull --ff-only
if errorlevel 1 (
echo [ERROR] Git pull failed.
echo Resolve local changes, branch divergence, or network issues first.
goto :fail
)
echo [OK] Source code updated.
echo.
echo [2/6] Installing/updating root Node.js dependencies...
call npm install --no-audit --no-fund
if errorlevel 1 (
echo [ERROR] Root npm install failed.
goto :fail
)
echo [OK] Root Node.js dependencies updated.
echo.
echo [3/6] Installing/updating Vexus build dependencies...
pushd "rust-vexus-lite"
if errorlevel 1 (
echo [ERROR] Directory not found: rust-vexus-lite
goto :fail
)
call npm install --no-audit --no-fund
if errorlevel 1 (
popd
echo [ERROR] Vexus npm install failed.
goto :fail
)
popd
echo [OK] Vexus build dependencies updated.
echo.
echo [4/6] Building Rust Vexus vector database module...
pushd "rust-vexus-lite"
if errorlevel 1 (
echo [ERROR] Directory not found: rust-vexus-lite
goto :fail
)
call npm run build
if errorlevel 1 (
popd
echo [ERROR] Vexus build failed.
goto :fail
)
popd
echo [OK] Rust Vexus module built.
echo.
echo [5/6] Building DailyNoteSearcher Rust module...
call npm run build:daily-note-searcher
if errorlevel 1 (
echo [ERROR] DailyNoteSearcher build failed.
goto :fail
)
echo [OK] DailyNoteSearcher built and deployed.
echo.
echo [6/6] Building CodeSearcher Rust module...
call npm run build:code-searcher
if errorlevel 1 (
echo [ERROR] CodeSearcher build failed.
goto :fail
)
echo [OK] CodeSearcher built and deployed.
echo.
echo ============================================================
echo [SUCCESS] VCPToolBox update completed successfully.
echo ============================================================
goto :success
:check_command
where %~1 >nul 2>&1
if errorlevel 1 (
echo [ERROR] Required command not found: %~2 ^(%~1^)
echo Install it and ensure it is available in PATH.
exit /b 1
)
echo [OK] Found %~2.
exit /b 0
:fail_directory
echo [ERROR] Unable to enter the script directory: %~dp0
:fail
echo.
echo ============================================================
echo [FAILED] Update stopped. Review the error message above.
echo ============================================================
if /I not "%~1"=="--no-pause" pause
exit /b 1
:success
if /I not "%~1"=="--no-pause" pause
exit /b 0