feat-add-windows-bat-launcher#1861
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a Windows batch launcher (deepseek-tui.bat) that attempts to use Windows Terminal for execution. Review feedback identifies critical JavaScript syntax errors in the string literals used to generate the batch file and suggests using the /c flag instead of /k for the command prompt. Additionally, the reviewer pointed out that the update to the asset matrix is incomplete because helper functions are hardcoded to ignore more than two assets, and the generation logic is incorrectly restricted to Windows host environments, which would likely cause issues in Linux-based CI/CD pipelines.
| " wt --title DeepSeek-TUI cmd /k ""%~dp0deepseek-tui-windows-x64.exe"", | ||
| ") else (", | ||
| " "%~dp0deepseek-tui-windows-x64.exe"", |
There was a problem hiding this comment.
This block contains critical JavaScript syntax errors. The string literals are not properly closed or escaped (specifically the double quotes used for the batch file paths), which will cause the script to fail with a SyntaxError.
Additionally, cmd /k is used in the Windows Terminal command; /k keeps the terminal window open after the application exits, whereas /c is generally preferred for a launcher to allow the window/tab to close automatically when the TUI app is exited.
| " wt --title DeepSeek-TUI cmd /k ""%~dp0deepseek-tui-windows-x64.exe"", | |
| ") else (", | |
| " "%~dp0deepseek-tui-windows-x64.exe"", | |
| " wt --title DeepSeek-TUI cmd /c \"\"%~dp0deepseek-tui-windows-x64.exe\"\"", | |
| ") else (", | |
| " \"%~dp0deepseek-tui-windows-x64.exe\"", |
| }, | ||
| win32: { | ||
| x64: ["deepseek-windows-x64.exe", "deepseek-tui-windows-x64.exe"], | ||
| x64: ["deepseek-windows-x64.exe", "deepseek-tui-windows-x64.exe", "deepseek-tui.bat"], |
There was a problem hiding this comment.
Adding deepseek-tui.bat to the ASSET_MATRIX is a necessary step, but it is currently incomplete. The helper functions detectBinaryNames (line 26) and allAssetNames (line 102) are hardcoded to only process the first two elements of the asset array (pair[0] and pair[1]).
This means the .bat file will be ignored by the installation script (install.js) and won't be included in the full asset list for checksum verification or downloading. You should update those functions to handle the entire array (e.g., using the spread operator ...pair).
|
|
||
|
|
||
| // Windows: generate .bat launcher that prefers Windows Terminal | ||
| if (isWindows) { |
There was a problem hiding this comment.
The isWindows check (which relies on process.platform === 'win32') prevents the .bat file from being generated when this script is run on non-Windows environments, such as Linux-based CI/CD runners. Since the .bat file is a static text asset intended for the Windows release, it should be generated whenever Windows assets are being prepared, regardless of the host operating system.
if (isWindows || prepareAllAssets) {There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30aa40cbed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "set NO_ANIMATIONS=1", | ||
| "where wt >nul 2>nul", | ||
| "if %ERRORLEVEL% EQU 0 (", | ||
| " wt --title DeepSeek-TUI cmd /k ""%~dp0deepseek-tui-windows-x64.exe"", |
There was a problem hiding this comment.
Escape inner quotes in BAT command strings
The new batContent entries use unescaped double quotes, so Node fails to parse this file with SyntaxError: Unexpected string before main() runs. This breaks every invocation of scripts/release/prepare-local-release-assets.js (including scripts/release/npm-wrapper-smoke.js, which calls it on line 147), so release-asset preparation now fails on all platforms, not just Windows.
Useful? React with 👍 / 👎.
No description provided.