Skip to content

Commit

Permalink
Fix the OPL-update script (or really the download-OPL-metadata-releas…
Browse files Browse the repository at this point in the history
…e.pl script)

The `download-OPL-metadata-release.pl` is extracting the downloaded
metadata release to the wrong directory, and so the rest of the script
fails.  It fails quietly, and doesn't actually restore any tables. So a
die statement was added to cover this case.
  • Loading branch information
drgrice1 committed Mar 22, 2024
1 parent 264b4ac commit 313be00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/download-OPL-metadata-release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ BEGIN

my $arch = Archive::Tar->new($releaseFile);
die "An error occurred while creating the tar file: $releaseFile" unless $arch;
$arch->setcwd($path);
$arch->extract();
$arch->setcwd($ce->{webworkDirs}{tmp});
$arch->extract;
die "There was an error extracting the metadata release: $arch->error" if $arch->error;

die "The downloaded archive did not contain the expected files."
unless -e "$ce->{webworkDirs}{tmp}/webwork-open-problem-library";

# Copy the json files into htdocs.
for (glob("$ce->{webworkDirs}{tmp}/webwork-open-problem-library/JSON-SAVED/*.json")) {
copy($_, "$ce->{webworkDirs}{htdocs}/DATA/") or die "Copy $_ to $ce->{webworkDirs}{htdocs}/DATA/ failed: $!";
Expand Down

0 comments on commit 313be00

Please sign in to comment.