aboutsummaryrefslogtreecommitdiffstats
path: root/bin/problem-creation-graph
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-10-23 12:48:46 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-10-23 12:48:46 +0100
commita9eb6707b478f28b0d2e61cb264ddf56b3342015 (patch)
tree33b1e2b0559f0a853d7899fe15d1f0bdc837d3c5 /bin/problem-creation-graph
parentc0923031e00cc788a954483f4963069803c725b8 (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/problem-creation-graph')
-rwxr-xr-xbin/problem-creation-graph8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/problem-creation-graph b/bin/problem-creation-graph
index c3d10f934..9fb4501a3 100755
--- a/bin/problem-creation-graph
+++ b/bin/problem-creation-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);
@@ -113,6 +113,6 @@ $gp .= <<END;
"< awk 'BEGIN { n = 0 } { n += \$2; print \$1, \$2, n; }' $sources{unconfirmed}" using 1:3 axes x1y2 with lines lt 0 title "cumulative total number of problems"
END
-open(my $gnuplot, '|-', "GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera gnuplot > web/fms-live-creation$config{extension} 2> /dev/null");
+open(my $gnuplot, '|-', "GDFONTPATH=/usr/share/fonts/truetype/ttf-bitstream-vera gnuplot > $DIR/web/fms-live-creation$config{extension} 2> /dev/null");
$gnuplot->print($gp);
close $gnuplot;