Skip to content

Fix miniprogram-automator startup on Ubuntu 25.04#172

Open
TrueNine wants to merge 1 commit intomsojocs:masterfrom
TrueNine:codex/fix-miniprogram-automator-ubuntu-25-04
Open

Fix miniprogram-automator startup on Ubuntu 25.04#172
TrueNine wants to merge 1 commit intomsojocs:masterfrom
TrueNine:codex/fix-miniprogram-automator-ubuntu-25-04

Conversation

@TrueNine
Copy link
Copy Markdown

Summary

This PR fixes a Linux CLI startup regression that prevents miniprogram-automator from launching WeChat DevTools on Ubuntu 25.04.

Root cause

bin/wechat-devtools-cli exported APPDATA to the bundled nwjs directory instead of the user profile directory used by the normal desktop launcher, and it did not export USERPROFILE. 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

  • align the CLI launcher with the desktop launcher's XDG-based data directory handling
  • export USERPROFILE consistently for CLI-launched sessions
  • ensure the CLI bootstrap creates the profile directory before writing coordination files
  • make CLI service startup deterministic and only report readiness after listen() succeeds
  • keep the service port enabled for CLI-launched sessions so automation can connect reliably

Why this matters

miniprogram-automator relies 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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

不要使用直接替换的补丁形式,请参考https://github.com/msojocs/wechat-web-devtools-linux/blob/master/res/scripts/cli.js中的方式。

举例

f=require("fs")缺失,也许可以通过global.f=require("fs")来处理。

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.

2 participants