Source control files in templates dir are moved to output

2 views
Skip to first unread message

James Allen

unread,
May 7, 2009, 12:27:06 PM5/7/09
to docu
Hi all,

I ran into a minor issue when running Docu for my project - at the end
of the generation process Docu moves some all files from the templates
directory (except those with .spark extension) to the output
directory:

foreach (string file in Directory.GetFiles(templatePath, "*",
SearchOption.AllDirectories))
{
if (Path.GetExtension(file) == ".spark") continue;
... move the files
}

But when you have docu in a directory under source control (e.g.
'tools') alongside your source code, you may also have a directory
called '.svn' (in the caser of SubVersion) in the templates directory
which will also be moved to the output, which is undesirable. What I
have done is to use this line instead:

if (Path.GetExtension(file) == ".spark" || file.Contains("svn"))
continue;

but this will vary depending on what source control you use for the
tools (if any). It may even be better to adopt a white-list approach
rather than a black-list?

Hope this helps!

James

Josh Flanagan

unread,
May 7, 2009, 3:51:16 PM5/7/09
to docu-...@googlegroups.com
I read this message this morning, but didn't think about it much... and then promptly ran into the same problem a few hours later.

I went ahead an implemented it so that it ignores hidden files and folders. That should be a little more universal than looking for specific SCM cruft, and I think makes some logical sense.

You can get my changes from:

James Gregory

unread,
May 7, 2009, 5:58:09 PM5/7/09
to docu-...@googlegroups.com
Ah the pitfalls of using git :) This obviously hadn't crossed my mind, but a whitelist sounds like a good idea.

Josh: Your changes look good, I certainly think that'd catch most cases.
Reply all
Reply to author
Forward
0 new messages