We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7b5e6e commit ffa6159Copy full SHA for ffa6159
packages/create-tldraw/src/utils.ts
@@ -1,5 +1,5 @@
1
import { isCancel, outro } from '@clack/prompts'
2
-import { existsSync, readdirSync } from 'node:fs'
+import { existsSync, readdirSync, statSync } from 'node:fs'
3
import { basename, resolve } from 'node:path'
4
5
export function nicelog(...args: unknown[]) {
@@ -12,6 +12,10 @@ export function isDirEmpty(path: string) {
12
return true
13
}
14
15
+ if (!statSync(path).isDirectory()) {
16
+ return false
17
+ }
18
+
19
const files = readdirSync(path)
20
return files.length === 0 || (files.length === 1 && files[0] === '.git')
21
0 commit comments