diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-01-15 15:33:21 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-01-19 16:35:37 +0000 |
commit | 8e6d48d5ee351594fc92f1e680ba4a2219ed57ca (patch) | |
tree | a32bdde6047f357663883a995393a945e1dadff2 /setenv.pl | |
parent | 96dd07e7c1dab2c8f9250af435caad2c2818b5a2 (diff) |
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.
Diffstat (limited to 'setenv.pl')
-rwxr-xr-x | setenv.pl | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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"; |