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("--target-url", targetUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push(
|
args.push("--output-root", normalize(outputRoot));
|
||||||
"--output-root",
|
|
||||||
normalize(outputRoot),
|
if (lessons) {
|
||||||
"--lessons",
|
args.push("--lessons", normalize(lessons));
|
||||||
normalize(lessons)
|
}
|
||||||
);
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
sseWriter.write(
|
sseWriter.write(
|
||||||
@@ -170,6 +169,12 @@ function readDirectory(sourceDir) {
|
|||||||
result["SKILL.md"] = fs.readFileSync(skillMdPath, "utf-8");
|
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 = {};
|
const scripts = {};
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
if (entry.isFile() && entry.name.endsWith(".js")) {
|
if (entry.isFile() && entry.name.endsWith(".js")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user