feat(generator-runner): read index.html in readDirectory()
🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
@@ -29,12 +29,11 @@ function runGenerator(params, sseWriter, projectRoot) {
|
||||
args.push("--target-url", targetUrl);
|
||||
}
|
||||
|
||||
args.push(
|
||||
"--output-root",
|
||||
normalize(outputRoot),
|
||||
"--lessons",
|
||||
normalize(lessons)
|
||||
);
|
||||
args.push("--output-root", normalize(outputRoot));
|
||||
|
||||
if (lessons) {
|
||||
args.push("--lessons", normalize(lessons));
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
sseWriter.write(
|
||||
@@ -170,6 +169,12 @@ function readDirectory(sourceDir) {
|
||||
result["SKILL.md"] = fs.readFileSync(skillMdPath, "utf-8");
|
||||
}
|
||||
|
||||
// Read index.html
|
||||
const indexHtmlPath = p.join(sourceDir, "index.html");
|
||||
if (fs.existsSync(indexHtmlPath)) {
|
||||
result.indexHtml = fs.readFileSync(indexHtmlPath, "utf-8");
|
||||
}
|
||||
|
||||
const scripts = {};
|
||||
for (const entry of entries) {
|
||||
if (entry.isFile() && entry.name.endsWith(".js")) {
|
||||
|
||||
Reference in New Issue
Block a user