pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit 664fe1031ac63c50cf1b3edbf8c330d799ea489d
parent 1254eb34a5f58a7e045d9debe787a9c7e8e6c2ee
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Thu, 19 Mar 2015 03:18:49 -0600

gen_svg: tighten, use xmkdir instead of hand rolling

Diffstat:
Mgen_svg | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gen_svg b/gen_svg @@ -16,13 +16,11 @@ getopts("av", \%args); $| = 1 if ($args{v}); my $cfg = get_config(); -my $dbh = get_dbh($cfg->{"http"}, undef, $args{v}); +my $dbh = get_dbh($cfg->{http}, undef, $args{v}); -my $svg_dir = $cfg->{"http"}{"chroot"} . $cfg->{"http"}{"htdocs"} . "/svg"; -print "info: rendering svgs to $svg_dir\n" if ($args{v}); -unless (-d $svg_dir) { - mkdir $svg_dir or die "can't mkdir $svg_dir: $!"; -} +my $svg_dir = $cfg->{http}{chroot} . $cfg->{http}{htdocs} . "/svg"; +xmkdir($svg_dir, $args{v}); +print "info: svg output is $svg_dir\n" if ($args{v}); my ($left, $width, $right, $top, $height, $bottom) = (30, 900, 70, 20, 160, 20); my $total_width = $right + $width + $left;