-
Notifications
You must be signed in to change notification settings - Fork 250
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
fix(InputFileResolver): Don't exclude all files #210
Conversation
- Rename current progress-reporter to dots-reporter - Add new fancy progress-reporter
- Check currentFiles is not an empty array - Check if filePath is not a directory (/core.js/dist/vender/core.js)
* Add test for exclusion of file when the expression resolves in empty * Test that globbing only results in files, not directories.
- ProgressReporter
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.
Changes look good, but problem with ionic project is not solved
return Promise.all([this.previous.resolve(), globbingTask]).then(results => { | ||
const previousFiles = results[0]; | ||
const currentFiles = results[1]; | ||
// If this expression started with a '!', exclude current files | ||
if (this.ignore) { | ||
return previousFiles.filter(previousFile => currentFiles.some(currentFile => previousFile.path !== currentFile.path)); | ||
return previousFiles.filter(previousFile => currentFiles.every(currentFile => previousFile.path !== currentFile.path)); |
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.
Why does every work better than some. Can you explain that?
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.
When an expression starts with a !
(and needs to ignore all matching files), then every file resulting from the current globing expression should not match to any of the current files. every
makes sure of that.
For example:
previousFiles: ['file1', 'file2', 'expectedFile']
currentFiles: ['file1', 'file2', 'somefile']
- Expected result:
'expectedFile'
For an empty array, every
returns true. More info: https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/Array/every
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.
Ok, thanx for the explanation. De rest of the code seems good.
Thanks for reviewing! I'll merge it |
Stop excluding of all files when a globing expression starts with a
!
and not results in files.