From 052604605d47300530a498828158133127d9ceca Mon Sep 17 00:00:00 2001 From: Enzo Innocenzi Date: Tue, 20 Jan 2026 17:21:36 +0100 Subject: [PATCH] feat(console): allow overriding internal storage in `boot` --- packages/console/src/ConsoleApplication.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/console/src/ConsoleApplication.php b/packages/console/src/ConsoleApplication.php index 658b8a8d4..f8089159e 100644 --- a/packages/console/src/ConsoleApplication.php +++ b/packages/console/src/ConsoleApplication.php @@ -10,6 +10,7 @@ use Tempest\Core\Application; use Tempest\Core\Kernel; use Tempest\Core\Tempest; +use Tempest\Support\Str; final readonly class ConsoleApplication implements Application { @@ -18,13 +19,22 @@ public function __construct( private ConsoleArgumentBag $argumentBag, ) {} - /** @param \Tempest\Discovery\DiscoveryLocation[] $discoveryLocations */ + /** + * Boots the console application. + * + * @param string $name The name of the console application. + * @param string|null $root The root directory of the application. By default, the current working directory. + * @param \Tempest\Discovery\DiscoveryLocation[] $discoveryLocations The locations to use for class discovery. + * @param string|null $internalStorage The *absolute* internal storage directory for Tempest. + */ public static function boot( string $name = 'Tempest', ?string $root = null, array $discoveryLocations = [], + ?string $internalStorage = null, ): self { - $container = Tempest::boot($root, $discoveryLocations); + $internalStorage ??= '.' . Str\to_kebab_case($name); + $container = Tempest::boot($root, $discoveryLocations, $internalStorage); $application = $container->get(ConsoleApplication::class);