From 693331c6fb8c2592fb69c20c7c114c6fcc8169fc Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 25 Oct 2026 10:52:25 +0000 Subject: [PATCH 1/4] feat: update installer messages for clarity and enhance demo account instructions --- src/Console/Commands/NewCommand.php | 3 ++- src/Environments/Environment.php | 11 ++++++++--- src/Environments/HerdEnvironment.php | 2 +- .../Environments/EnvironmentHelpersTest.php | 10 ++++++++++ .../Feature/Environments/HerdEnvironmentTest.php | 16 ++++++++++++++++ tests/Unit/SuccessCalloutTest.php | 2 +- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/Console/Commands/NewCommand.php b/src/Console/Commands/NewCommand.php index c843a88..452360c 100644 --- a/src/Console/Commands/NewCommand.php +++ b/src/Console/Commands/NewCommand.php @@ -88,7 +88,8 @@ public function handle(): int return self::FAILURE; } - $this->line(' Setup continues below - see the final summary for the real next steps.'); + // Laravel's installer has just printed its own next steps; ours come at the end. + $this->line(' Laravel is ready. Now setting up Saucebase…'); $arguments = $this->installArguments($name, $driver, $stack, $ssl, $modules, $domain, $appName, $demo); $result = $this->call('install', $arguments); diff --git a/src/Environments/Environment.php b/src/Environments/Environment.php index 6bb3ab9..29f0556 100644 --- a/src/Environments/Environment.php +++ b/src/Environments/Environment.php @@ -135,9 +135,14 @@ protected function demoStep(InstallCommand $command): array { $password = $command->optionOrNull('demo') ? $this->readEnvValue($command, 'DEMO_PASSWORD') : null; - return $password === null ? [] : [ - "Sign in to any demo account with the password `{$password}`. It is DEMO_PASSWORD in .env, used when demo data is seeded", - ]; + if ($password === null) { + return []; + } + + // Auth's demo data has the one account that sees everything. + return [is_dir($command->path('modules/auth')) + ? "Sign in as `chef@saucebase.dev` (admin) with the password `{$password}`. Every demo account uses it; it is saved in .env as DEMO_PASSWORD" + : "Demo accounts use the password `{$password}`, saved in .env as DEMO_PASSWORD"]; } /** Hook: perform driver-specific steps before the module prompt. Return an exit code to abort, null to continue. */ diff --git a/src/Environments/HerdEnvironment.php b/src/Environments/HerdEnvironment.php index 0295fe8..6b39a09 100644 --- a/src/Environments/HerdEnvironment.php +++ b/src/Environments/HerdEnvironment.php @@ -59,7 +59,7 @@ protected function nextSteps(InstallCommand $command): array return [ ...($this->frontendBuilt ? [] : ['Install frontend dependencies: `npm install`']), $this->frontendBuilt ? 'For live reload while you edit: `npm run dev`' : 'Start Vite: `npm run dev`', - 'Open your app: `'.($this->readEnvValue($command, 'APP_URL') ?? '').'`', + 'Herd already serves your app: `'.($this->readEnvValue($command, 'APP_URL') ?? '').'`', ]; } diff --git a/tests/Feature/Environments/EnvironmentHelpersTest.php b/tests/Feature/Environments/EnvironmentHelpersTest.php index 33a1b56..8d127f1 100644 --- a/tests/Feature/Environments/EnvironmentHelpersTest.php +++ b/tests/Feature/Environments/EnvironmentHelpersTest.php @@ -98,6 +98,16 @@ public function test_a_demo_install_tells_the_user_the_demo_password(): void $this->assertStringContainsString('`s3cret`', $steps[0]); } + public function test_with_auth_it_names_the_admin_account_to_sign_in_with(): void + { + file_put_contents($this->tmp.'/.env', "DEMO_PASSWORD=s3cret\n"); + mkdir($this->tmp.'/modules/auth', recursive: true); + + $steps = $this->environment()->exposedDemoStep($this->command(demo: true)); + + $this->assertSame(['Sign in as `chef@saucebase.dev` (admin) with the password `s3cret`. Every demo account uses it; it is saved in .env as DEMO_PASSWORD'], $steps); + } + public function test_without_demo_content_no_password_is_shown(): void { file_put_contents($this->tmp.'/.env', "DEMO_PASSWORD=s3cret\n"); diff --git a/tests/Feature/Environments/HerdEnvironmentTest.php b/tests/Feature/Environments/HerdEnvironmentTest.php index edb96bd..f049cd1 100644 --- a/tests/Feature/Environments/HerdEnvironmentTest.php +++ b/tests/Feature/Environments/HerdEnvironmentTest.php @@ -55,6 +55,22 @@ public function test_it_links_and_secures_the_app_after_installing_it(): void $this->assertStringContainsString('APP_HOST=shop.test', (string) file_get_contents($this->app.'/.env')); } + public function test_the_summary_says_herd_already_serves_the_app(): void + { + $command = $this->command(installs: true, domain: 'shop.test'); + $env = new class extends HerdEnvironment + { + /** @return string[] */ + public function steps(InstallCommand $command): array + { + return $this->nextSteps($command); + } + }; + $env->run($command); + + $this->assertContains('Herd already serves your app: `https://shop.test`', $env->steps($command)); + } + public function test_without_ssl_it_only_links_and_serves_over_http(): void { $command = $this->command(installs: true, ssl: 'no'); diff --git a/tests/Unit/SuccessCalloutTest.php b/tests/Unit/SuccessCalloutTest.php index 423be0f..39d79cc 100644 --- a/tests/Unit/SuccessCalloutTest.php +++ b/tests/Unit/SuccessCalloutTest.php @@ -22,6 +22,6 @@ public function content(): array // A terminal hyperlink's escape codes count towards the callout's width and // push its right border out; terminals link a bare URL by themselves. - $this->assertSame(['Learn more: https://github.com/saucebase-dev/saucebase'], array_values($command->content())); + $this->assertSame(['Learn more: https://saucebase-dev.github.io/docs/'], array_values($command->content())); } } From 9fa5cdf2713ac6c30c556a7ed37e2d1f2c3fa293 Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 25 Oct 2026 15:15:10 +0000 Subject: [PATCH 2/4] feat: implement task handling in InstallCommand and add unit tests for task result verification --- src/Console/Commands/InstallCommand.php | 77 +++++++++++++++---------- tests/Unit/TaskResultTest.php | 54 +++++++++++++++++ 2 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 tests/Unit/TaskResultTest.php diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index c45d280..070b7fe 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -3,6 +3,7 @@ namespace Saucebase\Installer\Console\Commands; use Illuminate\Console\Command; +use Illuminate\Console\View\TaskResult; use Illuminate\Support\Facades\Process; use Illuminate\Support\Str; use Laravel\Prompts\Elements\Element; @@ -97,7 +98,7 @@ public function optionOrNull(string $key): string|array|bool|null public function path(string $relative = ''): string { - return $relative === '' ? $this->targetPath() : $this->targetPath().'/'.$relative; + return $relative === '' ? $this->targetPath() : $this->targetPath() . '/' . $relative; } /** @@ -175,7 +176,7 @@ protected function captureDomain(): void label: 'Which hostname will you use for this app?', default: $current, hint: 'Use localhost, or a custom domain such as myapp.test.', - validate: fn (string $value) => self::normalizeDomain($value) === null + validate: fn(string $value) => self::normalizeDomain($value) === null ? 'Enter a bare hostname, e.g. myapp.test' : null, ), @@ -215,7 +216,7 @@ public static function normalizeDomain(string $value): ?string */ protected function warnWhenDomainDoesNotResolve(string $domain): void { - if ($domain === 'localhost' || gethostbyname($domain.'.') !== $domain.'.') { + if ($domain === 'localhost' || gethostbyname($domain . '.') !== $domain . '.') { return; } @@ -318,7 +319,7 @@ public function install(): int $this->generateApplicationKey(); $installed = false; - $this->components->task('Installing Saucebase', function () use (&$installed) { + $this->task('Installing Saucebase', function () use (&$installed) { return $installed = $this->installCore(); }); @@ -351,8 +352,8 @@ protected function handleCIInstallation(): int $envOk = $this->ensureEnvFile(); $keyOk = $this->envHasAppKey(); - $this->components->task('Verifying .env', fn () => $envOk); - $this->components->task('Verifying app key', fn () => $keyOk); + $this->task('Verifying .env', fn() => $envOk); + $this->task('Verifying app key', fn() => $keyOk); if (! $envOk || ! $keyOk) { return self::FAILURE; @@ -451,8 +452,8 @@ public function nameProject(): void foreach ($keys as $key => [$default, $own]) { $value = (string) json_encode($own, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - $pattern = '/^(\s*"'.$key.'":\s*)'.preg_quote('"'.$default.'"', '/').'/m'; - $replace = fn (array $match): string => $match[1].$value; + $pattern = '/^(\s*"' . $key . '":\s*)' . preg_quote('"' . $default . '"', '/') . '/m'; + $replace = fn(array $match): string => $match[1] . $value; $modified = preg_replace_callback($pattern, $replace, $modified, 1) ?? $modified; } @@ -493,7 +494,7 @@ protected function applyIdentityToEnv(string $env, string $name, string $slug, s // (http://localhost:8000, which is what `composer dev` binds); only a custom // host needs correcting here. if ($native && $host !== 'localhost') { - $env = self::setEnvLine($env, 'APP_URL', 'http://'.$host); + $env = self::setEnvLine($env, 'APP_URL', 'http://' . $host); } return $env; @@ -502,7 +503,7 @@ protected function applyIdentityToEnv(string $env, string $name, string $slug, s /** A key's value from raw .env text, or null when the key is absent. */ public static function readEnvLine(string $env, string $key): ?string { - return preg_match('/^'.preg_quote($key, '/').'=(.*)$/m', $env, $m) === 1 + return preg_match('/^' . preg_quote($key, '/') . '=(.*)$/m', $env, $m) === 1 ? trim(trim($m[1]), "\"'") : null; } @@ -510,11 +511,11 @@ public static function readEnvLine(string $env, string $key): ?string /** Replace a key's value, appending the line when the key is absent. */ public static function setEnvLine(string $env, string $key, string $value): string { - $pattern = '/^'.preg_quote($key, '/').'=.*$/m'; + $pattern = '/^' . preg_quote($key, '/') . '=.*$/m'; return preg_match($pattern, $env) ? preg_replace($pattern, "{$key}={$value}", $env) - : rtrim($env, "\n")."\n{$key}={$value}\n"; + : rtrim($env, "\n") . "\n{$key}={$value}\n"; } /** The password every demo account gets: the one in .env, or a new random one saved there. */ @@ -540,7 +541,7 @@ public function envHasAppKey(): bool protected function generateApplicationKey(): void { - $this->components->task('Generating application key', function () { + $this->task('Generating application key', function () { if ($this->envHasAppKey()) { return true; } @@ -556,7 +557,7 @@ protected function setupDatabase(): bool $command = $fresh ? 'migrate:fresh' : 'migrate'; $ok = false; - $this->components->task($label, function () use ($command, &$ok) { + $this->task($label, function () use ($command, &$ok) { return $ok = $this->runArtisan([$command, '--seed', '--force'], 300); }); @@ -574,8 +575,8 @@ protected function setupModules(): bool // Fast path: skip Packagist discovery when all requested names are fully qualified if ($opt) { - $names = array_values(array_filter(array_map(fn ($n) => strtolower(trim($n)), explode(',', $opt)))); - if ($names && ! array_filter($names, fn ($n) => ! str_contains($n, '/'))) { + $names = array_values(array_filter(array_map(fn($n) => strtolower(trim($n)), explode(',', $opt)))); + if ($names && ! array_filter($names, fn($n) => ! str_contains($n, '/'))) { return $this->doInstallModules($names); } } @@ -611,7 +612,7 @@ protected function setupModules(): bool */ public function doInstallModules(array $selected, ?\Closure $run = null): bool { - $run ??= fn (array $command, int $timeout): bool => $this->runArtisan(array_slice($command, 2), $timeout); + $run ??= fn(array $command, int $timeout): bool => $this->runArtisan(array_slice($command, 2), $timeout); if ($this->option('demo')) { $this->demoPassword(); @@ -620,10 +621,12 @@ public function doInstallModules(array $selected, ?\Closure $run = null): bool $this->newLine(); $ok = false; - $this->components->task('Installing modules', function () use ($selected, $run, &$ok) { + $this->task('Installing modules', function () use ($selected, $run, &$ok) { return $ok = $run([ - 'php', 'artisan', 'saucebase:module-install', - ...array_map(fn (string $package) => Str::after($package, '/'), $selected), + 'php', + 'artisan', + 'saucebase:module-install', + ...array_map(fn(string $package) => Str::after($package, '/'), $selected), '--no-interaction', ...($this->option('demo') ? ['--demo'] : []), ], 900); @@ -631,7 +634,7 @@ public function doInstallModules(array $selected, ?\Closure $run = null): bool if (! $ok) { $this->components->warn('Installing modules failed. Run it again to see why: php artisan saucebase:module-install ' - .implode(' ', array_map(fn (string $package) => Str::after($package, '/'), $selected))); + . implode(' ', array_map(fn(string $package) => Str::after($package, '/'), $selected))); } return $ok; @@ -659,7 +662,7 @@ protected function resolveModuleSelection(array $available): array // 2. Modules passed via --modules option if ($modules = $this->option('modules')) { $requested = collect(explode(',', $modules)) - ->map(fn ($m) => strtolower(trim($m))) + ->map(fn($m) => strtolower(trim($m))) ->filter() ->values(); @@ -677,12 +680,28 @@ protected function resolveModuleSelection(array $available): array protected function createStorageLink(): void { - $this->components->task('Creating storage link', fn () => $this->runArtisan(['storage:link'])); + $this->task('Creating storage link', fn() => $this->runArtisan(['storage:link'])); } protected function clearCaches(): void { - $this->components->task('Clearing caches', fn () => $this->runArtisan(['optimize:clear'])); + $this->task('Clearing caches', fn() => $this->runArtisan(['optimize:clear'])); + } + + /** + * A progress line for one step. Laravel shows FAIL only for its own failure value + * and DONE for anything else, `false` included, so a failed step looked done. + */ + protected function task(string $label, callable $step): bool + { + $ok = false; + $this->components->task($label, function () use ($step, &$ok) { + return ($ok = (bool) $step()) + ? TaskResult::Success->value + : TaskResult::Failure->value; + }); + + return $ok; } protected function isCI(): bool @@ -749,7 +768,7 @@ public function resumeCommand(array $resumeOptions = []): string $command = 'saucebase install'; if ($this->selectedStack) { - $command .= ' '.$this->selectedStack; + $command .= ' ' . $this->selectedStack; } foreach ($resumeOptions as $option => $value) { @@ -757,16 +776,16 @@ public function resumeCommand(array $resumeOptions = []): string } if ($this->domain !== null) { - $command .= ' --domain='.$this->domain; + $command .= ' --domain=' . $this->domain; } if ($modules = $this->resumeModules()) { - $command .= ' --modules='.$modules; + $command .= ' --modules=' . $modules; } foreach (['all-modules', 'dev', 'fresh', 'force', 'demo'] as $flag) { if ($this->optionOrNull($flag)) { - $command .= ' --'.$flag; + $command .= ' --' . $flag; } } @@ -774,7 +793,7 @@ public function resumeCommand(array $resumeOptions = []): string return $target === rtrim((string) getcwd(), '/') ? $command - : 'cd '.$this->quotePath($target).' && '.$command; + : 'cd ' . $this->quotePath($target) . ' && ' . $command; } /** The --modules value for a resume run, or null when selection was never resolved. */ diff --git a/tests/Unit/TaskResultTest.php b/tests/Unit/TaskResultTest.php new file mode 100644 index 0000000..57d6083 --- /dev/null +++ b/tests/Unit/TaskResultTest.php @@ -0,0 +1,54 @@ +command(); + + $this->assertFalse($command->step(fn () => false)); + $this->assertStringContainsString('FAIL', $output->fetch()); + } + + public function test_a_step_that_succeeds_is_shown_as_done(): void + { + [$command, $output] = $this->command(); + + $this->assertTrue($command->step(fn () => true)); + $this->assertStringContainsString('DONE', $output->fetch()); + } + + /** @return array{0: object, 1: BufferedOutput} */ + private function command(): array + { + $output = new BufferedOutput; + $style = new OutputStyle(new ArrayInput([]), $output); + + $command = new class($style) extends InstallCommand + { + public function __construct(OutputStyle $style) + { + parent::__construct(); + $this->output = $style; + $this->components = new Factory($style); + } + + public function step(callable $task): bool + { + return $this->task('Step', $task); + } + }; + + return [$command, $output]; + } +} From 03a81a2a35c47b650d7d9d6f36e1167236dfcbaa Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 25 Oct 2026 15:25:33 +0000 Subject: [PATCH 3/4] fix: update success callout link to point to the correct GitHub repository --- tests/Unit/SuccessCalloutTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/SuccessCalloutTest.php b/tests/Unit/SuccessCalloutTest.php index 39d79cc..423be0f 100644 --- a/tests/Unit/SuccessCalloutTest.php +++ b/tests/Unit/SuccessCalloutTest.php @@ -22,6 +22,6 @@ public function content(): array // A terminal hyperlink's escape codes count towards the callout's width and // push its right border out; terminals link a bare URL by themselves. - $this->assertSame(['Learn more: https://saucebase-dev.github.io/docs/'], array_values($command->content())); + $this->assertSame(['Learn more: https://github.com/saucebase-dev/saucebase'], array_values($command->content())); } } From 166d90ce32ab5682c41a8be1fbf468e17ea2d2ce Mon Sep 17 00:00:00 2001 From: roble <3231587+roble@users.noreply.github.com> Date: Sun, 25 Oct 2026 15:26:43 +0000 Subject: [PATCH 4/4] PHP Linting (Pint) --- src/Console/Commands/InstallCommand.php | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index 070b7fe..70a32eb 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -98,7 +98,7 @@ public function optionOrNull(string $key): string|array|bool|null public function path(string $relative = ''): string { - return $relative === '' ? $this->targetPath() : $this->targetPath() . '/' . $relative; + return $relative === '' ? $this->targetPath() : $this->targetPath().'/'.$relative; } /** @@ -176,7 +176,7 @@ protected function captureDomain(): void label: 'Which hostname will you use for this app?', default: $current, hint: 'Use localhost, or a custom domain such as myapp.test.', - validate: fn(string $value) => self::normalizeDomain($value) === null + validate: fn (string $value) => self::normalizeDomain($value) === null ? 'Enter a bare hostname, e.g. myapp.test' : null, ), @@ -216,7 +216,7 @@ public static function normalizeDomain(string $value): ?string */ protected function warnWhenDomainDoesNotResolve(string $domain): void { - if ($domain === 'localhost' || gethostbyname($domain . '.') !== $domain . '.') { + if ($domain === 'localhost' || gethostbyname($domain.'.') !== $domain.'.') { return; } @@ -352,8 +352,8 @@ protected function handleCIInstallation(): int $envOk = $this->ensureEnvFile(); $keyOk = $this->envHasAppKey(); - $this->task('Verifying .env', fn() => $envOk); - $this->task('Verifying app key', fn() => $keyOk); + $this->task('Verifying .env', fn () => $envOk); + $this->task('Verifying app key', fn () => $keyOk); if (! $envOk || ! $keyOk) { return self::FAILURE; @@ -452,8 +452,8 @@ public function nameProject(): void foreach ($keys as $key => [$default, $own]) { $value = (string) json_encode($own, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - $pattern = '/^(\s*"' . $key . '":\s*)' . preg_quote('"' . $default . '"', '/') . '/m'; - $replace = fn(array $match): string => $match[1] . $value; + $pattern = '/^(\s*"'.$key.'":\s*)'.preg_quote('"'.$default.'"', '/').'/m'; + $replace = fn (array $match): string => $match[1].$value; $modified = preg_replace_callback($pattern, $replace, $modified, 1) ?? $modified; } @@ -494,7 +494,7 @@ protected function applyIdentityToEnv(string $env, string $name, string $slug, s // (http://localhost:8000, which is what `composer dev` binds); only a custom // host needs correcting here. if ($native && $host !== 'localhost') { - $env = self::setEnvLine($env, 'APP_URL', 'http://' . $host); + $env = self::setEnvLine($env, 'APP_URL', 'http://'.$host); } return $env; @@ -503,7 +503,7 @@ protected function applyIdentityToEnv(string $env, string $name, string $slug, s /** A key's value from raw .env text, or null when the key is absent. */ public static function readEnvLine(string $env, string $key): ?string { - return preg_match('/^' . preg_quote($key, '/') . '=(.*)$/m', $env, $m) === 1 + return preg_match('/^'.preg_quote($key, '/').'=(.*)$/m', $env, $m) === 1 ? trim(trim($m[1]), "\"'") : null; } @@ -511,11 +511,11 @@ public static function readEnvLine(string $env, string $key): ?string /** Replace a key's value, appending the line when the key is absent. */ public static function setEnvLine(string $env, string $key, string $value): string { - $pattern = '/^' . preg_quote($key, '/') . '=.*$/m'; + $pattern = '/^'.preg_quote($key, '/').'=.*$/m'; return preg_match($pattern, $env) ? preg_replace($pattern, "{$key}={$value}", $env) - : rtrim($env, "\n") . "\n{$key}={$value}\n"; + : rtrim($env, "\n")."\n{$key}={$value}\n"; } /** The password every demo account gets: the one in .env, or a new random one saved there. */ @@ -575,8 +575,8 @@ protected function setupModules(): bool // Fast path: skip Packagist discovery when all requested names are fully qualified if ($opt) { - $names = array_values(array_filter(array_map(fn($n) => strtolower(trim($n)), explode(',', $opt)))); - if ($names && ! array_filter($names, fn($n) => ! str_contains($n, '/'))) { + $names = array_values(array_filter(array_map(fn ($n) => strtolower(trim($n)), explode(',', $opt)))); + if ($names && ! array_filter($names, fn ($n) => ! str_contains($n, '/'))) { return $this->doInstallModules($names); } } @@ -612,7 +612,7 @@ protected function setupModules(): bool */ public function doInstallModules(array $selected, ?\Closure $run = null): bool { - $run ??= fn(array $command, int $timeout): bool => $this->runArtisan(array_slice($command, 2), $timeout); + $run ??= fn (array $command, int $timeout): bool => $this->runArtisan(array_slice($command, 2), $timeout); if ($this->option('demo')) { $this->demoPassword(); @@ -626,7 +626,7 @@ public function doInstallModules(array $selected, ?\Closure $run = null): bool 'php', 'artisan', 'saucebase:module-install', - ...array_map(fn(string $package) => Str::after($package, '/'), $selected), + ...array_map(fn (string $package) => Str::after($package, '/'), $selected), '--no-interaction', ...($this->option('demo') ? ['--demo'] : []), ], 900); @@ -634,7 +634,7 @@ public function doInstallModules(array $selected, ?\Closure $run = null): bool if (! $ok) { $this->components->warn('Installing modules failed. Run it again to see why: php artisan saucebase:module-install ' - . implode(' ', array_map(fn(string $package) => Str::after($package, '/'), $selected))); + .implode(' ', array_map(fn (string $package) => Str::after($package, '/'), $selected))); } return $ok; @@ -662,7 +662,7 @@ protected function resolveModuleSelection(array $available): array // 2. Modules passed via --modules option if ($modules = $this->option('modules')) { $requested = collect(explode(',', $modules)) - ->map(fn($m) => strtolower(trim($m))) + ->map(fn ($m) => strtolower(trim($m))) ->filter() ->values(); @@ -680,12 +680,12 @@ protected function resolveModuleSelection(array $available): array protected function createStorageLink(): void { - $this->task('Creating storage link', fn() => $this->runArtisan(['storage:link'])); + $this->task('Creating storage link', fn () => $this->runArtisan(['storage:link'])); } protected function clearCaches(): void { - $this->task('Clearing caches', fn() => $this->runArtisan(['optimize:clear'])); + $this->task('Clearing caches', fn () => $this->runArtisan(['optimize:clear'])); } /** @@ -768,7 +768,7 @@ public function resumeCommand(array $resumeOptions = []): string $command = 'saucebase install'; if ($this->selectedStack) { - $command .= ' ' . $this->selectedStack; + $command .= ' '.$this->selectedStack; } foreach ($resumeOptions as $option => $value) { @@ -776,16 +776,16 @@ public function resumeCommand(array $resumeOptions = []): string } if ($this->domain !== null) { - $command .= ' --domain=' . $this->domain; + $command .= ' --domain='.$this->domain; } if ($modules = $this->resumeModules()) { - $command .= ' --modules=' . $modules; + $command .= ' --modules='.$modules; } foreach (['all-modules', 'dev', 'fresh', 'force', 'demo'] as $flag) { if ($this->optionOrNull($flag)) { - $command .= ' --' . $flag; + $command .= ' --'.$flag; } } @@ -793,7 +793,7 @@ public function resumeCommand(array $resumeOptions = []): string return $target === rtrim((string) getcwd(), '/') ? $command - : 'cd ' . $this->quotePath($target) . ' && ' . $command; + : 'cd '.$this->quotePath($target).' && '.$command; } /** The --modules value for a resume run, or null when selection was never resolved. */