Skip to content

feat-add-windows-bat-launcher#1861

Open
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:feat/windows-bat-launcher
Open

feat-add-windows-bat-launcher#1861
cy2311 wants to merge 1 commit into
Hmbown:mainfrom
cy2311:feat/windows-bat-launcher

Conversation

@cy2311
Copy link
Copy Markdown

@cy2311 cy2311 commented May 21, 2026

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +73 to +75
" wt --title DeepSeek-TUI cmd /k ""%~dp0deepseek-tui-windows-x64.exe"",
") else (",
" "%~dp0deepseek-tui-windows-x64.exe"",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
" 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"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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) {

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants