mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
use spaces instead of commas in flags
This commit is contained in:
@@ -10,6 +10,7 @@ import { createReadme } from "./create-readme";
|
||||
import { setupDatabase } from "./db-setup";
|
||||
import { setupEnvironmentVariables } from "./env-setup";
|
||||
import { setupExamples } from "./examples-setup";
|
||||
import { installDependencies } from "./install-dependencies";
|
||||
import { displayPostInstallInstructions } from "./post-installation";
|
||||
import { initializeGit, updatePackageConfigurations } from "./project-config";
|
||||
import { setupRuntime } from "./runtime-setup";
|
||||
@@ -91,6 +92,14 @@ export async function createProject(options: ProjectConfig): Promise<string> {
|
||||
await updatePackageConfigurations(projectDir, options);
|
||||
await createReadme(projectDir, options);
|
||||
|
||||
if (!options.noInstall) {
|
||||
await installDependencies({
|
||||
projectDir,
|
||||
packageManager: options.packageManager,
|
||||
addons: options.addons,
|
||||
});
|
||||
}
|
||||
|
||||
displayPostInstallInstructions(
|
||||
options.database,
|
||||
options.projectName,
|
||||
|
||||
@@ -81,7 +81,6 @@ app.post("/ai", async (c) => {
|
||||
return stream(c, (stream) => stream.pipe(result.toDataStream()));
|
||||
});`;
|
||||
|
||||
// Add the import section
|
||||
if (indexContent.includes("import {")) {
|
||||
const lastImportIndex = indexContent.lastIndexOf("import");
|
||||
const endOfLastImport = indexContent.indexOf("\n", lastImportIndex);
|
||||
@@ -94,7 +93,6 @@ ${indexContent.substring(endOfLastImport + 1)}`;
|
||||
${indexContent}`;
|
||||
}
|
||||
|
||||
// Add the route handler
|
||||
const trpcHandlerIndex =
|
||||
indexContent.indexOf('app.use("/trpc"') ||
|
||||
indexContent.indexOf("app.use(trpc(");
|
||||
@@ -103,7 +101,6 @@ ${indexContent}`;
|
||||
|
||||
${indexContent.substring(trpcHandlerIndex)}`;
|
||||
} else {
|
||||
// Add it near the end before export
|
||||
const exportIndex = indexContent.indexOf("export default");
|
||||
if (exportIndex !== -1) {
|
||||
indexContent = `${indexContent.substring(0, exportIndex)}${aiRouteHandler}
|
||||
|
||||
Reference in New Issue
Block a user