From 2e9261ca7e325a533d2ebd547ef61e14a579f6a8 Mon Sep 17 00:00:00 2001 From: Arnaud Lemercier Date: Sat, 31 Aug 2024 02:45:38 +0200 Subject: [PATCH] fix(#512): repack command work without .castor folder https://github.com/jolicode/castor/issues/512 --- CHANGELOG.md | 1 + src/Console/Command/RepackCommand.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ced101dd..86c6a9f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## 0.18.1 (2024-09-03) * Fix BC layer for `fingerprint()` function +* Fix repack command work without .castor folder ## 0.18.0 (2024-08-27) diff --git a/src/Console/Command/RepackCommand.php b/src/Console/Command/RepackCommand.php index 65e34313..18120fab 100644 --- a/src/Console/Command/RepackCommand.php +++ b/src/Console/Command/RepackCommand.php @@ -116,10 +116,12 @@ class RepackedApplication extends Application ]; // Add .castor directory - $boxConfig['directories'] = [ - '.castor', - ...$boxConfig['directories'] ?? [], - ]; + if (file_exists('.castor')) { + $boxConfig['directories'] = [ + '.castor', + ...$boxConfig['directories'] ?? [], + ]; + } // Force discovery $boxConfig['force-autodiscovery'] = true;