At first I thought my issues were related to Windows, but I'm experiencing the same behavior in Linux as well (and also using slash
to transform any Windows-specific paths).
I've created a test repo here: https://github.com/dlong500/node-cli-base
In my real projects I'm using several types of glob patterns, but the test repo above demonstrates a relatively simple pattern:
/opt/nodejs/node-cli-base/testdata/test?/?
Assuming a testdata folder contents of the following folders:
/opt/nodejs/node-cli-base/testdata/keep/
/opt/nodejs/node-cli-base/testdata/keep/textfile.txt
/opt/nodejs/node-cli-base/testdata/test1/0
/opt/nodejs/node-cli-base/testdata/test1/1
/opt/nodejs/node-cli-base/testdata/test1/2
/opt/nodejs/node-cli-base/testdata/test1/10
/opt/nodejs/node-cli-base/testdata/test1/11
/opt/nodejs/node-cli-base/testdata/test1/12
/opt/nodejs/node-cli-base/testdata/test2/0
/opt/nodejs/node-cli-base/testdata/test2/1
/opt/nodejs/node-cli-base/testdata/test2/2
/opt/nodejs/node-cli-base/testdata/test2/10
/opt/nodejs/node-cli-base/testdata/test2/11
/opt/nodejs/node-cli-base/testdata/test2/12
I would expect the following folders to be deleted:
/opt/nodejs/node-cli-base/testdata/test1/0
/opt/nodejs/node-cli-base/testdata/test1/1
/opt/nodejs/node-cli-base/testdata/test1/2
/opt/nodejs/node-cli-base/testdata/test2/0
/opt/nodejs/node-cli-base/testdata/test2/1
/opt/nodejs/node-cli-base/testdata/test2/2
I get the expected result with del v4.1.1, but no folders are deleted at all with del 5.1.0.
What exactly am I doing wrong? I've read through all the documentation and it doesn't seem like any glob pattern syntax has changed. I've also tried passing extglob: true
, onlyFiles: false
, and caseSensitiveMatch: false
just to see if the behavior changes (even though I believe those are defaults) to no avail.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too