Skip to content
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

Merged
merged 9 commits into from
Dec 31, 2016

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Dec 30, 2016

Stop excluding of all files when a globing expression starts with a ! and not results in files.

avassem85 and others added 8 commits December 28, 2016 17:16
- 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.
Copy link
Contributor

@avassem85 avassem85 left a 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));
Copy link
Contributor

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?

Copy link
Member Author

@nicojs nicojs Dec 31, 2016

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

Copy link
Contributor

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.

@avassem85 avassem85 closed this Dec 31, 2016
@avassem85 avassem85 reopened this Dec 31, 2016
@nicojs
Copy link
Member Author

nicojs commented Dec 31, 2016

Thanks for reviewing! I'll merge it

@nicojs nicojs merged commit ef3dde4 into master Dec 31, 2016
@nicojs nicojs deleted the fix-bugs-with-ionic-test branch December 31, 2016 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants