fix(code-tools): redirect bun output to log file on Windows#13400
Draft
GeorgeDong32 wants to merge 2 commits intomainfrom
Draft
fix(code-tools): redirect bun output to log file on Windows#13400GeorgeDong32 wants to merge 2 commits intomainfrom
GeorgeDong32 wants to merge 2 commits intomainfrom
Conversation
On Windows, `cmd.exe` can misinterpret multiline output from global CLI tool installations (e.g., Bun), leading to command execution failures. This change redirects the standard output and error of CLI tool installation commands to a log file on Windows, preventing `cmd.exe` from misinterpreting the output. This ensures more reliable and stable installations of CLI tools. Log files are created in the application's user data directory.
Replace app.getPath('userData') with loggerService.getLogsDir() to ensure
CLI tool install logs are written to the same directory as other Cherry
Studio logs. Removes unused 'app' import from electron.
Fixes #12985
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
After this PR:
userData/logs/cli-tools-install.log(vialoggerService.getLogsDir())appimport from electronFixes #12985
Why we need it and why it was done in this way
The following tradeoffs were made:
>> "logfile" 2>&1) instead of--silentflag to preserve debug information for troubleshootingThe following alternatives were considered:
bun install --silent: Rejected because it would lose all debug information>/dev/null 2>&1: Rejected because it would completely discard output with no way to debug installation failuresLinks to places where the discussion took place: #12985
Breaking changes
None
Special notes for your reviewer
loggerService.getLogsDir()to ensure logs are written to the same directory as other Cherry Studio logsChecklist
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note