Fixes for generated_app.t so it doesn't rely on finding catalyst.pl in the current...
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index 5011e91..690aad1 100644 (file)
@@ -15,6 +15,8 @@ use Path::Class qw/dir file/;
 use File::ShareDir qw/dist_dir/;
 use namespace::autoclean;
 
+with 'MooseX::Emulate::Class::Accessor::Fast';
+
 my %cache;
 
 =head1 NAME
@@ -30,7 +32,10 @@ Catalyst::Helper - Bootstrap a Catalyst application
 sub get_sharedir_file {
     my ($self, @filename) = @_;
     my $dist_dir;
-    if (-d "inc/.author" && -f "lib/Catalyst/Helper.pm"
+    if (exists $ENV{CATALYST_DEVEL_SHAREDIR}) {
+        $dist_dir = $ENV{CATALYST_DEVEL_SHAREDIR};
+    }
+    elsif (-d "inc/.author" && -f "lib/Catalyst/Helper.pm"
             ) { # Can't use sharedir if we're in a checkout
                 # this feels horrible, better ideas?
         $dist_dir = 'share';