-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Glob processor for Docker images. #100
Conversation
lsu.iterateFiles(root, (f) => { | ||
const filepath = fspath.join(f.path, f.name); | ||
let exclude = false; | ||
exclusionGlobs.forEach((g) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a for loop and break when exclude is set to true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a function here. Normally you are right - we should break out of a loop as soon as possible. In this case the looping effort is insignificant. We'll only expect a few exclude patterns (<10) and the expensive minimatch is no longer executed once the exclude flag has been set. I prefer iterators to loops in JavaScript as variables have function score and not block scope - as such iterator functions are an effective way to avoid polluting the variable scope of the enclosing function with loop variables.
|
||
/** | ||
* Return a subdirectory of a given DiscoveredDirectory. Create | ||
* parent directories of the subdirectory if necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I miss something but where is a parent directory is created if necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 84/85. In the code it is a subdir as we go bottom-up however in the comment I write from the perspective of a subdirectory - so its parents are created (hence I write "parent directories of the subdirectory")...
🎉 This PR is included in version 1.30.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The manifestGlobs which can be defined in the inspect() options are now interpreted. This PR adds the ability to scan a given docker images for specific files and return their content.