Skip to content

Commit

Permalink
Merge pull request #335 from karlomikus/develop
Browse files Browse the repository at this point in the history
Fix filename check #333
  • Loading branch information
karlomikus authored Sep 22, 2024
2 parents 1395008 + d02c42a commit 8652746
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v4.0.2
## Fixes
- Fixed a bug where the bar import command checked the wrong filepath

# v4.0.1
## Fixes
- Fixed a bug where cocktails with substitutes + any other filter were not being filtered correctly
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Commands/BarImportRecipes.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ public function handle(): int
return Command::FAILURE;
}

$filename = $zipFileDisk->path($filename);
if (!$zipFileDisk->exists($filename)) {
$this->error(sprintf('File "%s" does not exist.', $filename));

return Command::FAILURE;
}

$filename = $zipFileDisk->path($filename);

$zip = new ZipArchive();
if ($zip->open($filename) !== true) {
$this->error(sprintf('Unable to open zip file: "%s"', $filename));
Expand Down

0 comments on commit 8652746

Please sign in to comment.