Sometimes I'd like to give ttree a directory as an argument and have
it recusively process all files in that directory tree. It seems as if
currently you can either have it process everything via the -a option, or
ask it to process a single template....but nothing in between.
So I am passing along this patch to ttree to allow it to take a directory
as an argument and "do the right thing".
If there's already a way to do this, please disregard.
If there is a more portable way to combine directory paths via File::Spec
that would be an improvement on my patch.
# ---------------------------- cut here ----------------------------------------
--- ttree-orig 2009-04-07 09:00:17.000000000 -0400
+++ ttree-new 2009-04-07 08:59:06.000000000 -0400
@@ -206,13 +203,7 @@
if (@ARGV) {
# explicitly process files specified on command lines
foreach my $file (@ARGV) {
-
- if ( -d "$srcdir/$file" ) {
- process_tree($file);
- }
- else {
- process_file($file, $srcdir ? "$srcdir/$file" : $file, force => 1);
- }
+ process_file($file, $srcdir ? "$srcdir/$file" : $file, force => 1);
}
}
else {
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates