Fix miniprogram-automator startup on Ubuntu 25.04#172
Open
TrueNine wants to merge 1 commit intomsojocs:masterfrom
Open
Fix miniprogram-automator startup on Ubuntu 25.04#172TrueNine wants to merge 1 commit intomsojocs:masterfrom
TrueNine wants to merge 1 commit intomsojocs:masterfrom
Conversation
msojocs
reviewed
Mar 29, 2026
Owner
There was a problem hiding this comment.
不要使用直接替换的补丁形式,请参考https://github.com/msojocs/wechat-web-devtools-linux/blob/master/res/scripts/cli.js中的方式。
举例
f=require("fs")缺失,也许可以通过global.f=require("fs")来处理。
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.
Summary
This PR fixes a Linux CLI startup regression that prevents
miniprogram-automatorfrom launching WeChat DevTools on Ubuntu 25.04.Root cause
bin/wechat-devtools-cliexportedAPPDATAto the bundlednwjsdirectory instead of the user profile directory used by the normal desktop launcher, and it did not exportUSERPROFILE. On Ubuntu 25.04 this leaves CLI runtime state in the wrong location, so DevTools cannot bootstrap the expected profile, CLI handshake files, and service-port state reliably.The CLI bootstrap path also needs to create the profile directory before writing
.cli,.ide, and.ide-status, and the CLI HTTP server should only be considered ready after the process has actually bound the requested port. In addition, CLI-launched sessions need to force the service-port startup path instead of waiting for the regular UI timing used by interactive launches.Changes
USERPROFILEconsistently for CLI-launched sessionslisten()succeedsWhy this matters
miniprogram-automatorrelies on the CLI path to start DevTools and connect to the local service endpoint. Without these fixes, Ubuntu 25.04 can fail before the CLI handshake is established, so automation cannot bring the IDE up.Main purpose
The main purpose of this change is to restore reliable Linux CLI startup on modern distributions by making CLI-launched DevTools use the same persistent runtime environment and service-port bootstrap flow as the normal desktop launcher.