Skip to content
Snippets Groups Projects
Commit 9ff8f622 authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

separate template types and components in file system

parent 8744a9a7
No related branches found
Tags v0.1.33
No related merge requests found
Showing
with 5 additions and 4 deletions
......@@ -30,7 +30,7 @@ export const installTemplate = async ({
* Copy the template files to the target directory.
*/
console.log("\nInitializing project with template:", template, "\n");
const templatePath = path.join(__dirname, template, framework);
const templatePath = path.join(__dirname, "types", template, framework);
const copySource = ["**"];
if (!eslint) copySource.push("!eslintrc.json");
......@@ -59,9 +59,10 @@ export const installTemplate = async ({
* Copy the selected chat engine files to the target directory and reference it.
*/
let relativeEngineDestPath;
const compPath = path.join(__dirname, "components");
if (framework === "express" || framework === "nextjs") {
console.log("\nUsing chat engine:", engine, "\n");
const enginePath = path.join(__dirname, "engines", engine);
const enginePath = path.join(compPath, "engines", engine);
relativeEngineDestPath =
framework === "nextjs"
? path.join("app", "api", "chat")
......@@ -88,7 +89,7 @@ export const installTemplate = async ({
*/
if (framework === "nextjs") {
console.log("\nUsing UI:", ui, "\n");
const uiPath = path.join(__dirname, "ui", ui);
const uiPath = path.join(compPath, "ui", ui);
const componentsPath = path.join("app", "components");
await copy("**", path.join(root, componentsPath, "ui"), {
parents: true,
......@@ -188,7 +189,7 @@ export const installPythonTemplate = async ({
framework,
}: InstallPythonTemplateArgs) => {
console.log("\nInitializing Python project with template:", template, "\n");
const templatePath = path.join(__dirname, template, framework);
const templatePath = path.join(__dirname, "types", template, framework);
await copy("**", root, {
parents: true,
cwd: templatePath,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment