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

'ignore:' option doesn't work on invidual file #3873

Closed
curbengh opened this issue Nov 19, 2019 · 2 comments
Closed

'ignore:' option doesn't work on invidual file #3873

curbengh opened this issue Nov 19, 2019 · 2 comments

Comments

@curbengh
Copy link
Contributor

@curbengh curbengh commented Nov 19, 2019

  1. Create more than one dummy files in source/foo/ folder
  2. Configure ignore:,
_config.yml
ignore:
  - '**/foo/dummy1.txt'

Expected behavior

public/foo/dummy1.txt should not exist

Actual behavior

public/foo/dummy1.txt is there

Workaround

Use exclude:, but it doesn't work in themes/ folder.


ignore currently works on folder level only,

_config.yml
ignore:
  - '**/foo'

Noticed this limitation while working on hexojs/hexo-generator-feed#110.

I haven't dive into source code for this issue yet, @seaoak can you help?

@seaoak

This comment has been minimized.

Copy link
Member

@seaoak seaoak commented Nov 20, 2019

I'm afraid I owe you an apology.
I was conscious this restriction when I made the PR #3797.
I understood it is intentional, but not documented yet.

This restriction is caused by the current implementation of lib/box/index.js.
In the definition of Box.prototype._readDir, all non-directory entries in a directory are returned unconditionally.

On the other hand, ignored: option of "chokidar" already supports individual files.
That is, the PR #3797 works well for individual files.
https://www.npmjs.com/package/chokidar

I understand that there are use cases such as files under themes/ folder.

I try to make a patch to improve lib/box/index.js.

@curbengh

This comment has been minimized.

Copy link
Contributor Author

@curbengh curbengh commented Dec 6, 2019

@curbengh curbengh closed this Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.