Skip to content

fix: 修复非官方引擎在 build 时版本号被错误覆盖的问题#940

Open
boomwwww wants to merge 1 commit intoOpenWebGAL:devfrom
boomwwww:fix-update-engine-version.js
Open

fix: 修复非官方引擎在 build 时版本号被错误覆盖的问题#940
boomwwww wants to merge 1 commit intoOpenWebGAL:devfrom
boomwwww:fix-update-engine-version.js

Conversation

@boomwwww
Copy link
Copy Markdown
Member

@boomwwww boomwwww commented May 3, 2026

添加了对于type字段的判断以解决问题

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 modifies the engine version update script to use webgalVersion for version tracking and introduces a conditional check to update the version field only for 'official' engine types. A review comment suggests adding a fallback for the oldVersion variable to prevent it from being undefined if the webgalVersion property is missing in the source file.

// 更新版本号
const oldVersion = engineJson.version;
engineJson.version = version;
const oldVersion = engineJson.webgalVersion;
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.

medium

oldVersion 现在被赋值为 engineJson.webgalVersion。如果该字段在 engine.json 中不存在(例如在旧版本的引擎中),oldVersion 将会是 undefined。这可能会导致后续的日志输出不够清晰。建议增加回退到 engineJson.version 的逻辑。

Suggested change
const oldVersion = engineJson.webgalVersion;
const oldVersion = engineJson.webgalVersion || engineJson.version;

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.

1 participant