Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 2a68d90

Browse files
committed
feat(cli): Exit(1) if the directory contains conflict
1 parent e194c49 commit 2a68d90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/init.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import util from '../shared/util.ts'
88
import { defaultReactVersion } from '../shared/constants.ts'
99
import { VERSION } from '../version.ts'
1010
import { x_brotli, x_flate } from '../server/compress.ts'
11+
import isFolderEmpty from './helpers/is-folder-empty.ts';
1112

1213
export const helpMessage = `
1314
Usage:
@@ -28,6 +29,10 @@ export default async function (nameArg?: string) {
2829
return
2930
}
3031

32+
if (!isFolderEmpty(cwd, name)) {
33+
Deno.exit(1)
34+
}
35+
3136
const template = 'hello-world' // todo: add template select ui
3237
const vscode = await confirm('Add recommended workspace settings of VS Code?')
3338

0 commit comments

Comments
 (0)