fix: Escape parentheses in batch script echo statements
Parentheses in Chinese text (本地模式) and (雲端模式) were being interpreted as if/else block delimiters, causing both echo statements to execute regardless of the DATABASE_TYPE condition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -349,11 +349,11 @@ REM 使用 PowerShell 更新 database.type (使用 UTF8 without BOM)
|
|||||||
if /i "%DATABASE_TYPE%"=="sqlite" (
|
if /i "%DATABASE_TYPE%"=="sqlite" (
|
||||||
REM SQLite 模式: 設定 type=sqlite,清空 MySQL 連線資訊
|
REM SQLite 模式: 設定 type=sqlite,清空 MySQL 連線資訊
|
||||||
powershell -Command "$config = Get-Content '%CONFIG_FILE%' -Raw | ConvertFrom-Json; $config.backend.database.type = 'sqlite'; $config.backend.database.host = ''; $config.backend.database.user = ''; $config.backend.database.password = ''; $config.backend.database.database = ''; $json = $config | ConvertTo-Json -Depth 10; [System.IO.File]::WriteAllText('%CONFIG_FILE%', $json, [System.Text.UTF8Encoding]::new($false))"
|
powershell -Command "$config = Get-Content '%CONFIG_FILE%' -Raw | ConvertFrom-Json; $config.backend.database.type = 'sqlite'; $config.backend.database.host = ''; $config.backend.database.user = ''; $config.backend.database.password = ''; $config.backend.database.database = ''; $json = $config | ConvertTo-Json -Depth 10; [System.IO.File]::WriteAllText('%CONFIG_FILE%', $json, [System.Text.UTF8Encoding]::new($false))"
|
||||||
echo %GREEN%[OK]%NC% 資料庫類型已設定為: SQLite (本地模式)
|
echo %GREEN%[OK]%NC% 資料庫類型已設定為: SQLite ^(本地模式^)
|
||||||
) else (
|
) else (
|
||||||
REM MySQL 模式: 僅設定 type=mysql,保留連線資訊
|
REM MySQL 模式: 僅設定 type=mysql,保留連線資訊
|
||||||
powershell -Command "$config = Get-Content '%CONFIG_FILE%' -Raw | ConvertFrom-Json; $config.backend.database.type = 'mysql'; $json = $config | ConvertTo-Json -Depth 10; [System.IO.File]::WriteAllText('%CONFIG_FILE%', $json, [System.Text.UTF8Encoding]::new($false))"
|
powershell -Command "$config = Get-Content '%CONFIG_FILE%' -Raw | ConvertFrom-Json; $config.backend.database.type = 'mysql'; $json = $config | ConvertTo-Json -Depth 10; [System.IO.File]::WriteAllText('%CONFIG_FILE%', $json, [System.Text.UTF8Encoding]::new($false))"
|
||||||
echo %GREEN%[OK]%NC% 資料庫類型已設定為: MySQL (雲端模式)
|
echo %GREEN%[OK]%NC% 資料庫類型已設定為: MySQL ^(雲端模式^)
|
||||||
)
|
)
|
||||||
|
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
|
|||||||
Reference in New Issue
Block a user