Skip to content

Commit

Permalink
Fix extraction and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Jun 20, 2024
1 parent 2919b22 commit 5a56cc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Drivers/MaxMind.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ public function update(Command $command): void

$file = $this->discoverDatabaseFile($archive);

$relativePath = implode('/', [
Str::afterLast($file->getPath(), DIRECTORY_SEPARATOR),
$file->getFilename(),
]);
$directory = Str::afterLast($file->getPath(), DIRECTORY_SEPARATOR);

$relativePath = implode('/', [$directory, $file->getFilename()]);

$archive->extractTo($storage->path('/'), $relativePath, true);

file_put_contents(
$this->getDatabasePath(),
fopen($storage->path($file->getFilename()), 'r')
fopen($storage->path($relativePath), 'r')
);

$storage->delete($tarFileName);
$storage->deleteDirectory($directory);
}

/**
Expand Down

0 comments on commit 5a56cc5

Please sign in to comment.