Skip to content

Commit

Permalink
🐛 Fix adding .gitignore file to project (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Dec 25, 2024
1 parent e1daaeb commit d7cae95
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 142 deletions.
2 changes: 0 additions & 2 deletions libs/create-qwikdev-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"scripts": {
"check": "tsc --noEmit",
"build": "pnpm check && tsup-node --env.NODE_ENV production",
"prepublishOnly": "node --loader tsm src/prepare.ts",
"postpublish": "node --loader tsm src/prepare.ts --restore",
"start": "tsup-node --env.NODE_ENV development --watch",
"test": "NODE_ENV=test node --loader tsm --enable-source-maps bin/test.ts"
},
Expand Down
11 changes: 11 additions & 0 deletions libs/create-qwikdev-astro/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ export class Application extends Program<Definition, Input> {

this.step(`Creating new project in ${this.bgBlue(` ${outDir} `)} ... 🐇`);
this.copyTemplate(input, templatePath);
this.copyGitignore(input);
}

async start(input: Input): Promise<boolean> {
Expand Down Expand Up @@ -471,6 +472,16 @@ export class Application extends Program<Definition, Input> {
}
}

copyGitignore(input: Input) {
this.step("Copying `.gitignore` file...");

if (!input.dryRun) {
const gitignore = path.join(__dirname, "..", "stubs", "gitignore");
const dotGitignore = path.join(input.outDir, ".gitignore");
cpSync(gitignore, dotGitignore, { force: true });
}
}

copyTemplate(input: Input, templatePath: string): void {
if (!input.dryRun) {
const outDir = input.outDir;
Expand Down
35 changes: 0 additions & 35 deletions libs/create-qwikdev-astro/src/prepare.ts

This file was deleted.

File renamed without changes.
21 changes: 0 additions & 21 deletions libs/create-qwikdev-astro/stubs/templates/deno/gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions libs/create-qwikdev-astro/stubs/templates/node-biome/gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions libs/create-qwikdev-astro/stubs/templates/node/gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions libs/create-qwikdev-astro/stubs/templates/none-biome/gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions libs/create-qwikdev-astro/stubs/templates/none/gitignore

This file was deleted.

0 comments on commit d7cae95

Please sign in to comment.