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

Skip hidden directories #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Skip hidden directories #2

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 8, 2014

Prevent zodiac from parsing and copying hidden directories like .git and .zod

@@ -26,5 +26,5 @@ END {
for (i = 0; i < length(opts); i++) {
optpart = optpart " " opts[i]
}
printf "find \"%s\" -type f \\( %s \\) -exec zod-%s \"%s\" \"%s\" \"%s\" {} \\;", proj, optpart, phase, zod_lib, proj, target
printf "find \"%s\" -not -path \"*/\\.*\" -type f \\( %s \\) -exec zod-%s \"%s\" \"%s\" \"%s\" {} \\;", proj, optpart, phase, zod_lib, proj, target
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the [ignore] section in .zod/config is for, actually.

I agree that dotfiles don't really need to be processed. We could just add a line to the default configuration for ignoring files.

@nuex
Copy link
Owner

nuex commented Nov 9, 2014

Could you update your PR to replace line 14 with .* and removing the changes you made to find_cmd.awk?

@ghost
Copy link
Author

ghost commented Nov 9, 2014

Mmm... but that would not prevent zodiac from copying hidden directories and their content to the target dir.

@nuex
Copy link
Owner

nuex commented Nov 10, 2014

Did you try it? I just did using the example/site in the repo and it works for me.

@ghost
Copy link
Author

ghost commented Nov 10, 2014

EDIT:
Yes, I tried it and any hidden directory with some files in it get copied.
Adding *. to the [ignore] section in the config file doesn't solve the problem because find ! -name matches to the base name of the file which is the file path without the leading directories.
The simplest solution is to add a hard-coded expression in find_cmd.awk to skip everything that starts with a dot.

@ghost
Copy link
Author

ghost commented Feb 1, 2016

This would be very handy to ignore every .* for me. I could use it to make a .site dir a bit like jekyll _site. The .site would be my a repository pointing to username.github.io.

But the solution you provided in your example is also great and is the one I use for now.

By the way, I must really thank you for providing all the feature from jekyll with the minimal approach of a set of bash and awk scripts. Unfortunately, I can only set one star.

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.

None yet

2 participants