Skip to content

Commit ffa6159

Browse files
committed
Handle file paths in create-tldraw dir checks
1 parent f7b5e6e commit ffa6159

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/create-tldraw/src/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isCancel, outro } from '@clack/prompts'
2-
import { existsSync, readdirSync } from 'node:fs'
2+
import { existsSync, readdirSync, statSync } from 'node:fs'
33
import { basename, resolve } from 'node:path'
44

55
export function nicelog(...args: unknown[]) {
@@ -12,6 +12,10 @@ export function isDirEmpty(path: string) {
1212
return true
1313
}
1414

15+
if (!statSync(path).isDirectory()) {
16+
return false
17+
}
18+
1519
const files = readdirSync(path)
1620
return files.length === 0 || (files.length === 1 && files[0] === '.git')
1721
}

0 commit comments

Comments
 (0)