-
-
Save omega/2d2ddb6546830b89cab9 to your computer and use it in GitHub Desktop.
file::find patch for mojo::home
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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