fix: Ignore hidden files when traversing directories
This commit is contained in:
parent
7d99765589
commit
a4a0980cd3
@ -18,6 +18,10 @@ export function getAllFiles(dirPath: string, arrayOfFiles: FileType[] = []): Fil
|
|||||||
const files = fs.readdirSync(dirPath)
|
const files = fs.readdirSync(dirPath)
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
|
if (file.startsWith('.')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const fullPath = path.join(dirPath, file)
|
const fullPath = path.join(dirPath, file)
|
||||||
if (fs.statSync(fullPath).isDirectory()) {
|
if (fs.statSync(fullPath).isDirectory()) {
|
||||||
arrayOfFiles = getAllFiles(fullPath, arrayOfFiles)
|
arrayOfFiles = getAllFiles(fullPath, arrayOfFiles)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user