Skip to content

Instantly share code, notes, and snippets.

@omega
Created August 23, 2011 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omega/2d2ddb6546830b89cab9 to your computer and use it in GitHub Desktop.
Save omega/2d2ddb6546830b89cab9 to your computer and use it in GitHub Desktop.
file::find patch for mojo::home
diff --git a/lib/Mojo/Home.pm b/lib/Mojo/Home.pm
index 4487715..21c78a2 100644
--- a/lib/Mojo/Home.pm
+++ b/lib/Mojo/Home.pm
@@ -85,10 +85,10 @@ sub list_files {
$dir = File::Spec->catdir($root, split '/', ($dir || ''));
return [] unless -d $dir;
my @files;
- find sub {
+ find { wanted => sub {
push @files, join '/',
File::Spec->splitdir(File::Spec->abs2rel($File::Find::name, $dir));
- }, $dir;
+ }, no_chdir => 1}, $dir;
return [sort @files];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment