Skip to content

Commit

Permalink
Filter out symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
murilopolese committed Jun 28, 2023
1 parent 2053233 commit eacaa4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ function listFolder(folder) {
return files
}

function ilistFolder(folder, filesOnly) {
function ilistFolder(folder) {
let files = fs.readdirSync(path.resolve(folder))
files = files.filter(f => {
let filePath = path.resolve(folder, f)
return !fs.lstatSync(filePath).isSymbolicLink()
})
files = files.map(f => {
let filePath = path.resolve(folder, f)
return {
Expand Down

0 comments on commit eacaa4f

Please sign in to comment.