Skip to content

Commit

Permalink
Fix the check_latex script.
Browse files Browse the repository at this point in the history
The addition of the requirement of PG files for hardcopy (namely the
`pg.sty` file), means that the `check_latex` script needs to know where
the pg directory is.  So find that the same way the webwork2 app does.

This fixes issue openwebwork#2543.
  • Loading branch information
drgrice1 committed Sep 2, 2024
1 parent 16de8df commit 640994f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/check_latex
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ use feature 'say';

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use YAML::XS qw(LoadFile);
use Env qw(WEBWORK_ROOT PG_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
$WEBWORK_ROOT = curfile->dirname->dirname->to_string;

# Load the configuration file to obtain the PG root directory.
my $config_file = "$WEBWORK_ROOT/conf/webwork2.mojolicious.yml";
$config_file = "$WEBWORK_ROOT/conf/webwork2.mojolicious.dist.yml" unless -e $config_file;
my $config = LoadFile($config_file);

$PG_ROOT = $config->{pg_dir};
}

use File::Temp qw(tempdir);
Expand Down

0 comments on commit 640994f

Please sign in to comment.