feat: add sceneKind param to generator-runner
Pass sceneKind to sg_scene_generate CLI when specified, allowing generation of different scene kinds (report_collection, monitoring, etc.). 🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
@@ -2,7 +2,7 @@ const { spawn } = require("child_process");
|
||||
const path = require("path");
|
||||
|
||||
function runGenerator(params, sseWriter, projectRoot) {
|
||||
const { sourceDir, sceneId, sceneName, outputRoot, lessons } = params;
|
||||
const { sourceDir, sceneId, sceneName, sceneKind, outputRoot, lessons } = params;
|
||||
|
||||
const normalize = (p) => p.replace(/\\/g, "/");
|
||||
|
||||
@@ -17,11 +17,19 @@ function runGenerator(params, sseWriter, projectRoot) {
|
||||
sceneId,
|
||||
"--scene-name",
|
||||
sceneName,
|
||||
];
|
||||
|
||||
// 只有明确指定 sceneKind 时才添加参数(否则使用默认值 report_collection)
|
||||
if (sceneKind) {
|
||||
args.push("--scene-kind", sceneKind);
|
||||
}
|
||||
|
||||
args.push(
|
||||
"--output-root",
|
||||
normalize(outputRoot),
|
||||
"--lessons",
|
||||
normalize(lessons),
|
||||
];
|
||||
normalize(lessons)
|
||||
);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
sseWriter.write(
|
||||
|
||||
Reference in New Issue
Block a user