ui5-tooling
ui5-tooling copied to clipboard
fs.DuplexCollection byGlob returns wrong result
Hello guys,
I created a small sample, using the ui5-tooling with simple configuration and custom task.
I tried to exclude all files from processing, except for two types of files (.lit.js and .hbs), look at the ui5.yaml.
But, this seems to cause an issue in my custom task, when I try to execute
workspace.byGlob("/resources/*.hbs") - it matches not only .hbs files, but the .lit.js files as well.
Expected Behavior
workspace.byGlob("/resources/*.hbs") to match .hbs files only.
Current Behavior
workspace.byGlob("/resources/*.hbs") matches not just .hbs files, but .lit.js as well.
Steps to reproduce the issue
- Clone repository https://github.com/ilhan007/ui5-tooling-customtask-sample
- Run
npm installin the root - Run
npm run build - Explore the build log - the result from
workspace.byGlob("/resources/*.hbs")is logged and you can see that it finds not just.hbsfiles. Or, You can add debugger in the task at this line:https://github.com/ilhan007/ui5-tooling-customtask-sample/blob/master/lib/task.js#L5
Context
- UI5 Module Version (output of
ui5 --versionwhen using the CLI):1.12.1 - Node.js Version:
12.13.0 - npm Version:
6.12 - OS/Platform:
macOS 10.15 Catalina
Affected components (if known)
- [X] ui5-builder
Thanks for reporting! I looked into this and created https://github.com/SAP/ui5-fs/pull/193 with a possible implementation to resolve this. However, this depends on the implementation of a change in the upstream fast-glob library: https://github.com/mrmlnc/fast-glob/issues/86
Until then, every resource you re-include in your exclude patterns gets added to the result set, even if your actual glob pattern does not match it.