mirror of
https://github.com/HappyLifeOk/cc-3-8-x-mcp.git
synced 2026-08-21 05:57:14 +00:00
[cc-3-8-x-mcp] 修复: 补全离线 CLI 解析路径与自包含夹具
改了什么:解析结果记录资源来源路径,并生成独立 Prefab、嵌套资源和脚本夹具。 为什么:测试依赖外部项目资源和临时目录时会导致嵌套解析与类 ID 结果不稳定。 影响范围:离线 CLI 解析、组件引用错误信息及 offline tools 测试。
This commit is contained in:
@@ -19,7 +19,8 @@ const path = require('path');
|
||||
const os = require('os');
|
||||
|
||||
const BIN = path.resolve(__dirname, '../bin/cocos-mcp-cli.js');
|
||||
const FIXTURE = path.resolve(__dirname, 'fixtures/HomeUI.prefab');
|
||||
const fixture = require('./fixture.js');
|
||||
const FIXTURE = fixture.ensureHomeUiFixture();
|
||||
|
||||
function run(args) {
|
||||
return spawnSync(process.execPath, [BIN, ...args], {
|
||||
@@ -29,7 +30,7 @@ function run(args) {
|
||||
}
|
||||
|
||||
function tmpCopy() {
|
||||
const dest = path.join(os.tmpdir(), `HomeUI-cli-test-${Date.now()}.prefab`);
|
||||
const dest = path.join(fixture.FIXTURE_TEMP_DIR, `HomeUI-cli-test-${process.pid}-${Date.now()}.prefab`);
|
||||
fs.copyFileSync(FIXTURE, dest);
|
||||
return dest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user