dree icon indicating copy to clipboard operation
dree copied to clipboard

The scan doesn't ignore directories that match the pattern in `exclude` opts

Open webbby opened this issue 11 months ago • 1 comments

version: 5.0.8 OS: Ubuntu 22.04

The exclude scan option isn't respected in the following case


// chose a path of existing dir
const dir = '/mnt/Projects/Docker/';
const dirRegex = /^\/mnt\/Projects\/Docker\/$/i;

// test the regex ->   true
const testResult = dirRegex.test(dir);

const ignoreDirs = [dirRegex];

// the exclude scan options  isn't respected
const scanOpts = {
    stat: true,
    normalize: true,
    followLinks: true,
    size: true,
    hash: true,
    depth: 5,
    exclude: ignoreDirs,
    extensions: [ 'yml' ]
};

webbby avatar Mar 05 '25 22:03 webbby

I also assumed that the regex might exclude the folder but not it's nested children dirs. My case is exactly this, I want to exclude the whole folder tree under the exclude path

const dirRegex = /^\/mnt\/Projects\/Docker(.+)?$/i;

but still the rule is not respected

webbby avatar Mar 07 '25 12:03 webbby