Prompt to overwrite non-empty dirs before config

This commit is contained in:
Aman Varshney
2025-05-05 18:54:23 +05:30
parent ff13123bcb
commit 357dfbbbf9
29 changed files with 223 additions and 141 deletions

View File

@@ -4,13 +4,12 @@ import type { ProjectBackend, ProjectConfig } from "../types";
import { addPackageDependency } from "../utils/add-package-deps";
export async function setupRuntime(config: ProjectConfig): Promise<void> {
const { projectName, runtime, backend } = config;
const { projectName, runtime, backend, projectDir } = config;
if (backend === "convex" || backend === "next" || runtime === "none") {
return;
}
const projectDir = path.resolve(process.cwd(), projectName);
const serverDir = path.join(projectDir, "apps/server");
if (!(await fs.pathExists(serverDir))) {