This commit is contained in:
Netkas 2023-09-29 17:01:59 -04:00
parent 38ab509630
commit e1f813ab60
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 13 additions and 2 deletions

View file

@ -285,8 +285,16 @@
*/
private static function copyPackage(array $args): int
{
$copy_path = $args['o'];
if($copy_path === null)
{
Console::outError('Missing required option "-o"', true, 1);
return 1;
}
$package_reader = new PackageReader($args['path'] ?? $args['p']);
$package_reader->saveCopy($args['copy'] ?? $args['o']);
$package_reader->saveCopy($copy_path);
return 0;
}

View file

@ -668,7 +668,10 @@
}
// Copy the package file to the destination
stream_copy_to_stream($this->package_file, $destination, $this->package_length, $this->package_offset);
if(stream_copy_to_stream($this->package_file, $destination, $this->package_length, $this->package_offset) === false)
{
throw new IOException(sprintf('Failed to copy package file to \'%s\'', $path));
}
// Done!
fclose($destination);