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

A general setting for ignoring files #193

Closed
faridnsh opened this issue Apr 30, 2012 · 7 comments
Closed

A general setting for ignoring files #193

faridnsh opened this issue Apr 30, 2012 · 7 comments

Comments

@faridnsh
Copy link

I'm using vim. When I edit a file like a.js.coffee , I'll get another file beside it .a.js.coffee.swp . And in this case docpad copies them too. We should have a setting similar to .gitignore for matching file names that needs to be ignored.

@balupton
Copy link
Member

Hrmmm, well if we do /^\./ then .htaccess files won't be copied. It's a real annoying thing, as some editors will prefix with ~ too.

Perhaps what we need is to ignore /^(\.|\~)/ then have a whitelist.

@faridnsh
Copy link
Author

Well what I'm saying is to make it configurable rather than hardcoding.

@tobiash
Copy link

tobiash commented May 16, 2012

I have the same issue using Vim. When using docpad watch, it refreshes every time I type a character (as vim's buffer file gets updated). Is there any workaround for this apart from disabling Vim's buffer files completely?

@balupton
Copy link
Member

Happy to have this done. Is anyone willing to do a pull request?

@sfrdmn
Copy link

sfrdmn commented Oct 6, 2012

Looks like the best fix for this would be to pass user configuration to balUtil.scandir. There's a problem, though. 'scandir' takes an option ignorePatterns, which if true uses a default "common ignore patterns" regexp, or if given a RegExp object, uses that given RegExp object instead of the common ignore patterns.

Thing is, when specifying a custom regexp in Docpad (and probably in general), we want to concatenate that regexp to the defaults, not override them.

So I can either modify scandir's API such that there are two options: one boolean option which dictates whether to use the common ignore patterns and another option which specifies custom ignore patterns (which can, btw, be done in a backward compatible way), or I could modify Docpad such that it concatenates custom ignore patterns with the default ones and then passes that to 'scandir' for 'ignorePatterns'. The former seems cleanest.

Also, where would I stick a regexp concatenation function?

@balupton
Copy link
Member

In v6.8.3 (just published) you can now specify your own ignorePatterns regex via the docpad configuration. Thanks to @Delapouite for this.

balupton added a commit that referenced this issue Oct 22, 2012
- v6.8.3 October 22, 2012
	- Fixed growl generating notification from saying `generated` instead
of `generating`
	- Added `ignorePatterns` option
		- Closes [#193](#193) thanks to
[Bruno Héridet](https://github.com/Delapouite) for [pull request
#326](#326)
@balupton
Copy link
Member

As of v6.19 we now have the configuration options ignoreCommonPatterns and ignoreCustomPatterns

balupton added a commit that referenced this issue Oct 23, 2013
- v6.8.3 October 22, 2012
	- Fixed growl generating notification from saying `generated` instead
of `generating`
	- Added `ignorePatterns` option
		- Closes [#193](#193) thanks to
[Bruno Héridet](https://github.com/Delapouite) for [pull request
#326](#326)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants