diff --git a/bin/download-OPL-metadata-release.pl b/bin/download-OPL-metadata-release.pl index 32af39376a..2c6f3238bf 100755 --- a/bin/download-OPL-metadata-release.pl +++ b/bin/download-OPL-metadata-release.pl @@ -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: $!";