@duytransipher/gitnexus 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/unreal/bridge.js +29 -6
- package/package.json +1 -1
package/dist/unreal/bridge.js
CHANGED
|
@@ -33,6 +33,22 @@ async function runCommand(config, operation, args) {
|
|
|
33
33
|
maxBuffer: 10 * 1024 * 1024,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
async function readUELogErrors(config) {
|
|
37
|
+
try {
|
|
38
|
+
const projectDir = path.dirname(config.project_path);
|
|
39
|
+
const projectName = path.basename(config.project_path, '.uproject');
|
|
40
|
+
const logPath = path.join(projectDir, 'Saved', 'Logs', `${projectName}.log`);
|
|
41
|
+
const content = await fs.readFile(logPath, 'utf-8');
|
|
42
|
+
const lines = content.split(/\r?\n/);
|
|
43
|
+
const errorLines = lines.filter(l => /\bError\b/i.test(l) && !/^LogWindows.*Failed to get driver/i.test(l.replace(/^\[.*?\]\[\s*\d+\]/, '')));
|
|
44
|
+
if (errorLines.length === 0)
|
|
45
|
+
return '';
|
|
46
|
+
return 'UE Log errors:\n' + errorLines.slice(-10).join('\n');
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
36
52
|
async function readOutputJson(outputPath, stdout) {
|
|
37
53
|
try {
|
|
38
54
|
const raw = await fs.readFile(outputPath, 'utf-8');
|
|
@@ -48,20 +64,27 @@ export async function syncUnrealAssetManifest(storagePath, config) {
|
|
|
48
64
|
const args = buildBaseArgs(config, 'SyncAssets', outputPath);
|
|
49
65
|
try {
|
|
50
66
|
const { stdout } = await runCommand(config, 'SyncAssets', args);
|
|
51
|
-
const
|
|
52
|
-
const manifestPath = await saveUnrealAssetManifest(storagePath,
|
|
67
|
+
const manifest = await readOutputJson(outputPath, stdout);
|
|
68
|
+
const manifestPath = await saveUnrealAssetManifest(storagePath, manifest);
|
|
53
69
|
return {
|
|
54
70
|
status: 'success',
|
|
55
71
|
manifest_path: manifestPath,
|
|
56
|
-
asset_count:
|
|
57
|
-
generated_at:
|
|
58
|
-
warnings:
|
|
72
|
+
asset_count: manifest.assets.length,
|
|
73
|
+
generated_at: manifest.generated_at,
|
|
74
|
+
warnings: [],
|
|
59
75
|
};
|
|
60
76
|
}
|
|
61
77
|
catch (error) {
|
|
78
|
+
const stderr = error?.stderr ? String(error.stderr).trim() : '';
|
|
79
|
+
const stdout = error?.stdout ? String(error.stdout).trim() : '';
|
|
80
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
81
|
+
const ueLog = await readUELogErrors(config);
|
|
82
|
+
const details = [msg, stderr && `stderr: ${stderr}`, stdout && `stdout: ${stdout}`, ueLog]
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.join('\n');
|
|
62
85
|
return {
|
|
63
86
|
status: 'error',
|
|
64
|
-
error:
|
|
87
|
+
error: details,
|
|
65
88
|
};
|
|
66
89
|
}
|
|
67
90
|
}
|
package/package.json
CHANGED