-
Notifications
You must be signed in to change notification settings - Fork 239
Fix pattern matching in .vscodeignore #271
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
Conversation
|
@joaomoreno Is there something blocking the merging? |
| const resources = gulp.src('src/**') | ||
| .pipe(filter(['**', '!**/*.ts'])); | ||
| const resources = gulp.src('src/**', { dot: true }) | ||
| .pipe(filter(['**', '!**/*.ts'], { dot: 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.
Does this actually change anything?
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.
This is crucial, otherwise minimatch does not match dotted files and folders, resulting in .vscodeignore file and .vscode folder not getting included in the compiled output, thus the relative test fails.
gulpfile.js
Outdated
|
|
||
| function watch(task) { | ||
| return cb => gulp.watch(['src/**', 'typings/**'], [task]); | ||
| return () => gulp.watch(['src/**', 'typings/**'], [task]); |
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.
This is wrong since gulp checks for the args length of the function. If there is no parameter in the function, gulp expects a stream. If it doesn't return a stream, it marks the task as immediately completed. I suggest to leave the cb there.
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.
Have abandoned gulp years ago, so I have to admit that I don't remember how it works. Since it's crucial I'll revert this.
src/test/package.test.ts
Outdated
| // pattern of file name | ||
| if (!fs.existsSync(path.join(cwd, 'logger.log'))) { | ||
| fs.writeFileSync(path.join(cwd, 'logger.log'), 'log'); | ||
| } |
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.
We should create a fixture instead of generating it dynamically here, it would be easier to grasp and maintain.
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.
My original thought but I tried to keep the coding pattern. Will switch to fixture files.
| .then(stat => stat && stat.isDirectory() ? `${i}/**` : i); | ||
| }); | ||
| return Promise.all(promises).then<string[]>(i => Promise.resolve(i)); | ||
| }) |
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.
Is there really not a better way to do this without disk access?
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 can't think of another way to determine if an entry is a directory or a file. Suggestions are welcome.
Only my vacation 😎 |
|
Thanks! 🎆 I removed the |
|
🙄 Interesting approach. Since it works, fine by me. |
|
I guess no one was aware of the |
Fixes #265
This PR attempts to keep backward compatibility and be compliant with
Gitignoring pattern format (.gitignore)Test fixtures and case have been included.
Note:
fs.lstathas been used instead offs.exists(line 708), in order to be compliant with deprecation offs.existsinnode@10.x.fs.existsSyncwas not used deliberately, in order to avoid I/O blocking.