-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Milestone
Description
I wanted to monitor files inside a nested directory. Let's say src/app/entities/*.ts.
I tried using something like:
const hashResult = await folderHash.hashElement(projectDir, {
folders: {
include: [
'src/app/entities',
],
matchPath: true,
matchBasename: false,
},
files: {
include: ['*.entity.ts'],
},
encoding: 'hex',
})
But it didn't work since the nested directory segments are expected to match the include entries (eg. src is matched against src/app which doesn't match and therefore stops descending). Therefore I had to add separate entries for each level of nesting like this for it to work:
const hashResult = await folderHash.hashElement(projectDir, {
folders: {
include: [
'src',
'src/app',
'src/app/entities',
],
matchPath: true,
matchBasename: false,
},
files: {
include: ['*.entity.ts'],
},
encoding: 'hex',
})
It might be that I am just missing something or the support for nested include folders could be improved to handle this case.
Metadata
Metadata
Assignees
Labels
No labels