aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-10 00:13:33 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-10 00:13:33 +0100
commit7513161747fb9bd48eb67cc7a43e711e2a1b45a1 (patch)
tree392e384547b6ac5e80808022e9bc4f48ff893a7a
parent7e844f25b99b1b2b76526a0490b5b9dea00b71df (diff)
Simple cron wrapper to run in correct environment.
-rwxr-xr-xbin/cron-wrapper9
-rwxr-xr-xsetenv.pl6
-rw-r--r--t/app/controller/about.t2
3 files changed, 10 insertions, 7 deletions
diff --git a/bin/cron-wrapper b/bin/cron-wrapper
new file mode 100755
index 000000000..b93695cb0
--- /dev/null
+++ b/bin/cron-wrapper
@@ -0,0 +1,9 @@
+#!/usr/bin/env perl
+
+BEGIN { # set all the paths to the perl code
+ use FindBin;
+ require "$FindBin::Bin/../setenv.pl";
+}
+
+exec { $ARGV[0] } @ARGV;
+
diff --git a/setenv.pl b/setenv.pl
index b5461f30e..4564017bf 100755
--- a/setenv.pl
+++ b/setenv.pl
@@ -32,12 +32,6 @@ for ( "$root/commonlib/perllib", "$root/perllib" ) {
# also set the path to our scripts etc
$ENV{PATH} = join ':', uniq "$root/bin", split( m/:/, $ENV{PATH} );
-# now decide what to do - if no arguments print out shell arguments to set the
-# environment. If there are arguments then run those so that they run correctly
-#if (@ARGV) {
-# system @ARGV;
-#}
-
# we might want to require this file to configure something like a CGI script
if ( $0 eq __FILE__ ) {
diff --git a/t/app/controller/about.t b/t/app/controller/about.t
index 84eab005a..a5fb215d3 100644
--- a/t/app/controller/about.t
+++ b/t/app/controller/about.t
@@ -8,7 +8,7 @@ ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
# check that we can get the page
$mech->get_ok('/about');
-$mech->content_like(qr{About us ::\s+FixMyStreet.com});
+$mech->content_like(qr{About us ::\s+FixMyStreet});
$mech->content_contains('html lang="en-gb"');
SKIP: {