feat: 重组项目结构并完善运行管理
This commit is contained in:
+12
-2
@@ -2,7 +2,7 @@
|
||||
setlocal
|
||||
|
||||
for %%I in ("%~dp0..") do set "PROJECT_ROOT=%%~fI"
|
||||
set "WEB_DIR=%PROJECT_ROOT%\web"
|
||||
set "WEB_DIR=%PROJECT_ROOT%\src\web"
|
||||
set "LIBCLANG_PATH=%PROJECT_ROOT%\.tools\libclang\clang\native"
|
||||
|
||||
where cargo >nul 2>nul
|
||||
@@ -29,6 +29,16 @@ if not exist "%LIBCLANG_PATH%\libclang.dll" (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not exist "%PROJECT_ROOT%\dht-search.toml" (
|
||||
echo [INFO] Creating local configuration from template
|
||||
copy /Y "%PROJECT_ROOT%\dht-search.example.toml" "%PROJECT_ROOT%\dht-search.toml" >nul
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Failed to create dht-search.toml
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if not exist "%WEB_DIR%\node_modules" (
|
||||
echo [INFO] Installing Web dependencies
|
||||
pushd "%WEB_DIR%"
|
||||
@@ -60,7 +70,7 @@ powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
||||
" }" ^
|
||||
"}" ^
|
||||
"try {" ^
|
||||
" $backend = Start-Process -FilePath 'cargo' -ArgumentList @('run','-p','dht-search','--','--config','dht-search.example.toml') -WorkingDirectory $env:PROJECT_ROOT -NoNewWindow -PassThru;" ^
|
||||
" $backend = Start-Process -FilePath 'cargo' -ArgumentList @('run','-p','dht-search','--bin','dht-search','--','--config','dht-search.toml') -WorkingDirectory $env:PROJECT_ROOT -NoNewWindow -PassThru;" ^
|
||||
" $web = Start-Process -FilePath 'bun' -ArgumentList @('--bun','run','dev','--','--host','127.0.0.1') -WorkingDirectory $env:WEB_DIR -NoNewWindow -PassThru;" ^
|
||||
" while (-not $backend.HasExited -and -not $web.HasExited) { Start-Sleep -Milliseconds 250 }" ^
|
||||
"} finally {" ^
|
||||
|
||||
Reference in New Issue
Block a user