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

Allow ignore of directories #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cryptorick
Copy link

Before this commit, any line under the [ignore] section of .zod/config matched only filenames, not directory names. This commit allows the user to indicate whole directories to ignore. The user does
this by ending the name spec with /.

For instance, using the snippet

[ignore]
Makefile
.hide/

in .zod/config will cause zod to ignore files matching Makefile and directories matching .hide.

Additionally, directories matching .zod and .git are already ignored by default (as a convenience to the user).

Before this commit, any line under the `[ignore]` section of
`.zod/config` matched only filenames, not directory names.  This commit
allows the user to indicate whole directories to ignore.  The user does
this by ending the name spec with `/`.

For instance, using the snippet

```
[ignore]
Makefile
.hide/
```

in `.zod/config` will cause zod to ignore files matching `Makefile` and
directories matching `.hide`.

Additionally, directories matching `.zod` and `.git` are already ignored
by default (as a convenience to the user).
@cryptorick
Copy link
Author

cryptorick commented May 3, 2017

Hi Chase!

The idea behind this change -- which you will have gathered for yourself quickly, but I state here anyway for completeness sake -- is that, when the user indicates a directory spec in the [ignore] section (like .hide/), zod will, in part, emit a find command which looks like this

find "site" -type d \( -name ".zod" -o -name ".git" -o -name ".hide" \) -prune -o -type f \(  ! -name "helpers.awk" ! -name "*.partial" ! -name "*.layout" ! -name "*.meta" ! -name "*.html" ! -name "*.md" ! -name "*.htm" \) -exec zod-copy "/usr/local/lib/zodiac" "site" "www" {} \;

as opposed to the current behavior which would emit something like

find "site" -type f \(  ! -name "helpers.awk" ! -name "*.partial" ! -name "*.layout" ! -name "*.meta" ! -name "*.html" ! -name "*.md" ! -name "*.htm" \) -exec zod-copy "/usr/local/lib/zodiac" "site" "www" {} \;

the difference being the addition of the

-type d \( -name ".zod" -o -name ".git" -o -name ".hide" \) -prune -o

part (clause).

If you like this method and accept it -- I hope you do -- you should be able also to close the related PR #2 and then: no more open PRs. \o/

Also, it was good to get rid of config as an [ignore] spec on the off-chance that zod-copy needed to copy, say, some site resource file named config.

I tried to be thorough (including updating the doc), but please edit/correct anything I missed.

Oh, almost forgot: I tested this in OpenBSD 6.1 base and "Git Bash" on my employer's horrible Windows system they inflict on us. :) I think the latter is based on GNU tools.

Cheers, --Rick

@cryptorick
Copy link
Author

Bump. (I hope this finds you well and enjoying your summer!)

@nuex
Copy link
Owner

nuex commented Oct 6, 2017

I'll need to try these changes locally, but looks good.

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