Skip to content

Commit 5307bee

Browse files
author
Ramu Narasinga
committed
added comments helper function
1 parent aeb6af4 commit 5307bee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

create-next-app/helpers/is-folder-empty.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ export function isFolderEmpty(root: string, name: string): boolean {
2727
'.yarn',
2828
]
2929

30+
// Just conflicts? why not filesConflicts?
31+
// It is inferred that we are dealing with files,
32+
// I guess, there's no need to add
3033
const conflicts = fs.readdirSync(root).filter(
3134
(file) =>
35+
// validFiles are exempt from the logging
3236
!validFiles.includes(file) &&
3337
// Support IntelliJ IDEA-based editors
3438
!/\.iml$/.test(file)
@@ -39,6 +43,7 @@ export function isFolderEmpty(root: string, name: string): boolean {
3943
`The directory ${green(name)} contains files that could conflict:`
4044
)
4145
console.log()
46+
// Logs the files and directories
4247
for (const file of conflicts) {
4348
try {
4449
const stats = fs.lstatSync(path.join(root, file))

0 commit comments

Comments
 (0)