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

fix: don't allow frontend for non-streaming

parent c85bf225
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,12 @@ Select external port.
)
.allowUnknownOption()
.parse(process.argv);
if (process.argv.includes("--no-frontend")) {
program.frontend = false;
}
if (process.argv.includes("--no-eslint")) {
program.eslint = false;
}
const packageManager = !!program.useNpm
? "npm"
......
......@@ -89,14 +89,8 @@ export const askQuestions = async (
})),
initial: 0,
},
{
onCancel: () => {
console.error("Exiting.");
process.exit(1);
},
},
handlers,
);
program.communityProjectPath = communityProjectPath;
preferences.communityProjectPath = communityProjectPath;
return; // early return - no further questions needed for community projects
......@@ -130,11 +124,12 @@ export const askQuestions = async (
}
}
if (program.framework === "express" || program.framework === "fastapi") {
if (process.argv.includes("--no-frontend")) {
program.frontend = false;
}
if (
program.template === "streaming" &&
(program.framework === "express" || program.framework === "fastapi")
) {
// if a backend-only framework is selected, ask whether we should create a frontend
// (only for streaming backends)
if (program.frontend === undefined) {
if (ciInfo.isCI) {
program.frontend = getPrefOrDefault("frontend");
......@@ -161,7 +156,6 @@ export const askQuestions = async (
}
}
} else {
// single project if framework is nextjs
program.frontend = false;
}
......@@ -283,11 +277,7 @@ export const askQuestions = async (
preferences.openAiKey = key;
}
if (
program.framework !== "fastapi" &&
!process.argv.includes("--eslint") &&
!process.argv.includes("--no-eslint")
) {
if (program.framework !== "fastapi" && program.eslint === undefined) {
if (ciInfo.isCI) {
program.eslint = getPrefOrDefault("eslint");
} else {
......
......@@ -13,7 +13,7 @@ export interface InstallTemplateArgs {
isOnline: boolean;
template: TemplateType;
framework: TemplateFramework;
engine?: TemplateEngine;
engine: TemplateEngine;
ui: TemplateUI;
eslint: boolean;
customApiPath?: string;
......
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