From: Brian Cassidy Date: Fri, 2 Jun 2006 01:37:29 +0000 (+0000) Subject: conditional script gen check X-Git-Tag: 5.7099_04~553 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=0eb4af722418c249c10885d55a93cb8adfa2729b;hp=a0b07e39577d239d85f7f96fb833d75926b1296c conditional script gen check --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 6375a53..1068f27 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -776,8 +776,9 @@ sub setup { } } - $class->log->warn( - <<"EOF") if ( $ENV{CATALYST_SCRIPT_GEN} && ( $ENV{CATALYST_SCRIPT_GEN} < $Catalyst::CATALYST_SCRIPT_GEN ) ); + eval { require Catalyst::Devel; }; + if( !$@ && $ENV{CATALYST_SCRIPT_GEN} && ( $ENV{CATALYST_SCRIPT_GEN} < $Catalyst::Devel::CATALYST_SCRIPT_GEN ) ) { + $class->log->warn(<<"EOF"); You are running an old script! Please update by running (this will overwrite existing files): @@ -786,7 +787,8 @@ You are running an old script! or (this will not overwrite existing files): catalyst.pl -scripts $class EOF - + } + if ( $class->debug ) { my @plugins = ();