Skip to content

Commit 3124a6a

Browse files
Rename .gitignore to _gitignore and add renaming logic in CLI
1 parent 610e6c2 commit 3124a6a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.changeset/huge-cobras-dig.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-better-t-stack": patch
3+
---
4+
5+
fix .gitignore

apps/cli/src/helpers/create-project.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ export async function createProject(options: ProjectConfig): Promise<string> {
1818

1919
try {
2020
await fs.ensureDir(projectDir);
21-
2221
const templateDir = path.join(PKG_ROOT, "template/base");
2322
if (!(await fs.pathExists(templateDir))) {
2423
throw new Error(`Template directory not found: ${templateDir}`);
2524
}
2625
await fs.copy(templateDir, projectDir);
2726

27+
const gitignorePath = path.join(projectDir, "_gitignore");
28+
if (await fs.pathExists(gitignorePath)) {
29+
await fs.move(gitignorePath, path.join(projectDir, ".gitignore"));
30+
}
31+
2832
if (options.auth) {
2933
const authTemplateDir = path.join(PKG_ROOT, "template/with-auth");
3034
if (await fs.pathExists(authTemplateDir)) {
@@ -40,7 +44,6 @@ export async function createProject(options: ProjectConfig): Promise<string> {
4044

4145
if (await fs.pathExists(ormTemplateDir)) {
4246
await fs.copy(ormTemplateDir, projectDir, { overwrite: true });
43-
4447
const serverSrcPath = path.join(projectDir, "packages/server/src");
4548
const baseLibPath = path.join(serverSrcPath, "lib");
4649
const withAuthLibPath = path.join(serverSrcPath, "with-auth-lib");
@@ -80,7 +83,6 @@ export async function createProject(options: ProjectConfig): Promise<string> {
8083
}
8184
} else {
8285
await fs.remove(withAuthLibPath);
83-
8486
if (options.orm === "prisma") {
8587
const withAuthSchema = path.join(
8688
projectDir,
@@ -108,7 +110,6 @@ export async function createProject(options: ProjectConfig): Promise<string> {
108110
options.orm,
109111
options.turso ?? options.database === "sqlite",
110112
);
111-
112113
await setupAuth(projectDir, options.auth);
113114
await setupEnvironmentVariables(projectDir, options);
114115

File renamed without changes.

0 commit comments

Comments
 (0)