diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-10-23 12:48:46 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-10-23 12:48:46 +0100 |
commit | a9eb6707b478f28b0d2e61cb264ddf56b3342015 (patch) | |
tree | 33b1e2b0559f0a853d7899fe15d1f0bdc837d3c5 /bin/problems-filed-graph | |
parent | c0923031e00cc788a954483f4963069803c725b8 (diff) |
Don't use chdir in graph generation scripts.
Running the graph scripts from their directory does not work with
perl 5.16+, as the chdir interferes with FindBin's operation.
Fixes #1262.
Diffstat (limited to 'bin/problems-filed-graph')
-rwxr-xr-x | bin/problems-filed-graph | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/problems-filed-graph b/bin/problems-filed-graph index abfe0cf1a..cb8851b7f 100755 --- a/bin/problems-filed-graph +++ b/bin/problems-filed-graph @@ -10,12 +10,12 @@ use strict; use warnings; require 5.8.0; +my $DIR; BEGIN { use File::Basename qw(dirname); use File::Spec; - my $d = dirname(File::Spec->rel2abs($0)); - chdir "$d/.."; - require "$d/../setenv.pl"; + $DIR = dirname(dirname(File::Spec->rel2abs($0))); + require "$DIR/setenv.pl"; } use File::Temp qw(tempfile); @@ -62,6 +62,6 @@ my $gp = <<END; plot "$source" using 1:2 with lines axes x1y2 lt 3 title "FixMyStreet problem reports" END -open(my $gnuplot, '|-', "GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera gnuplot > web/fms-live-line$config{extension} 2> /dev/null"); +open(my $gnuplot, '|-', "GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera gnuplot > $DIR/web/fms-live-line$config{extension} 2> /dev/null"); $gnuplot->print($gp); close $gnuplot; |