From 8e6d48d5ee351594fc92f1e680ba4a2219ed57ca Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 15 Jan 2015 15:33:21 +0000 Subject: Remove need for cron-wrapper with existing scripts Call the necessary boilerplate in each script so you can call them directly. Remove boilerplate from files that don't need it. --- setenv.pl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'setenv.pl') diff --git a/setenv.pl b/setenv.pl index b0cf94a78..39dcc04b0 100755 --- a/setenv.pl +++ b/setenv.pl @@ -5,19 +5,18 @@ use warnings; my $root; -BEGIN { # add the local perllibs too - - # Can't use Path::Class here as we'd load the old debian one. - $root = __FILE__ =~ m{^(.*)/(web|bin)/\.\..*$} ? $1 : `pwd`; - chomp($root); +BEGIN { + use File::Basename qw(dirname); + use File::Spec; + $root = dirname(File::Spec->rel2abs(__FILE__)); } # Set the environment for the FixMyStreet project -# Add the lib/perl5 in perl-external so that we can load local::lib from there +# Add the lib/perl5 in local so that we can load local::lib from there use lib "$root/local/lib/perl5"; -# Add the perl-external dirs properly using local::lib +# Now add the local dir properly using local::lib use local::lib "$root/local"; use lib "$root/commonlib/perllib"; -- cgit v1.2.3