Skip to content

Commit 6712302

Browse files
committed
fix: use correct method to git init
1 parent 0fafb1d commit 6712302

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import {
1212
} from 'node:fs';
1313
import { join, resolve } from 'node:path';
1414
import { parseArgs } from 'node:util';
15-
import { isCancel, select, text , log} from '@clack/prompts';
15+
import { isCancel, select, text, log } from '@clack/prompts';
1616
import { kebabCase } from 'es-toolkit';
17+
import { execSync } from 'node:child_process';
1718

1819
const engines = ['deno', 'node', 'bun'] as const;
1920
type Engine = (typeof engines)[number];
@@ -91,7 +92,7 @@ async function ensureName(name?: string): Promise<string> {
9192
async function ensureTargetDir(name: string, target?: string): Promise<string> {
9293
if (target) return target;
9394

94-
const defaultName = kebabCase(name);
95+
const defaultName = `./${kebabCase(name)}`;
9596

9697
const response = await text({
9798
message: 'Where should the template be copied?',
@@ -208,7 +209,7 @@ async function main() {
208209
updateProjectName(targetPath, name);
209210

210211
if (args.values.git) {
211-
existsSync('git init');
212+
execSync('git init');
212213
}
213214

214215
log.success(`✅ Template "${engine}" copied to "${targetPath}"`);

0 commit comments

Comments
 (0)