From cb18e7fb17bf6fedc2f311d075a111029ffe3055 Mon Sep 17 00:00:00 2001 From: Alexander Wirt Date: Fri, 6 Jan 2012 08:50:40 +0100 Subject: [PATCH] ignore .git directorys --- gen_website | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gen_website b/gen_website index 398613e..e095187 100755 --- a/gen_website +++ b/gen_website @@ -8,14 +8,24 @@ use File::Find::Rule; use File::Path qw(make_path); use File::Basename qw (fileparse); use File::Copy::Recursive qw(fcopy); +use File::Temp qw (tempdir); my $out_dir = "out/"; #find all files -my @files = File::Find::Rule->file() - ->in('.'); +#rule to match git directorys +my $git = File::Find::Rule->directory + ->name(".git") + ->prune + ->discard; +#matches all files +my $file_rule = File::Find::Rule->file(); + +#combine both +my @files = File::Find::Rule->or( $git, $file_rule ) + ->in('.'); #initialize template toolkit -- 2.1.4