From caacbac01037f3f1c05b2addeda677abaa7b6967 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 12 Jul 2024 11:00:48 +0200 Subject: [PATCH 1/2] Remove extra space from signature --- .../src/Console/Commands/ChangeSourceDirectoryCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Console/Commands/ChangeSourceDirectoryCommand.php b/packages/framework/src/Console/Commands/ChangeSourceDirectoryCommand.php index 6bffde7f1ee..2b9f8cee5fa 100644 --- a/packages/framework/src/Console/Commands/ChangeSourceDirectoryCommand.php +++ b/packages/framework/src/Console/Commands/ChangeSourceDirectoryCommand.php @@ -27,7 +27,7 @@ class ChangeSourceDirectoryCommand extends Command { /** @var string */ - protected $signature = 'change:sourceDirectory {name : The new source directory name }'; + protected $signature = 'change:sourceDirectory {name : The new source directory name}'; /** @var string */ protected $description = 'Change the source directory for your project'; From d2b5002d44599304072f657ddc5316f181277e58 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 12 Jul 2024 12:35:16 +0200 Subject: [PATCH 2/2] Implement the option to skip diffing --- monorepo/DevTools/src/RefactorConfigCommand.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/monorepo/DevTools/src/RefactorConfigCommand.php b/monorepo/DevTools/src/RefactorConfigCommand.php index 927b26d5a26..721bb8cd26e 100644 --- a/monorepo/DevTools/src/RefactorConfigCommand.php +++ b/monorepo/DevTools/src/RefactorConfigCommand.php @@ -34,7 +34,7 @@ class RefactorConfigCommand extends Command protected const SUPPORTED_FORMATS = ['yaml']; /** @var string */ - protected $signature = 'refactor:config {format : The new configuration format}'; + protected $signature = 'refactor:config {format : The new configuration format} {--skip-diff : Skip diffing and dump the entire config}'; /** @var string */ protected $description = 'Migrate the configuration to a different format.'; @@ -59,7 +59,11 @@ protected function migrateToYaml(): int { $this->ensureYamlConfigDoesNotExist(); - $config = $this->getConfigDiff(); + $config = config('hyde'); + + if (! $this->option('skip-diff')) { + $config = $this->getDiffedConfig($config); + } if (empty($config)) { $this->warn("You don't seem to have any configuration to migrate."); @@ -84,9 +88,8 @@ protected function ensureYamlConfigDoesNotExist(): void } } - protected function getConfigDiff(): array + protected function getDiffedConfig($config): array { - $config = config('hyde'); $default = require Hyde::vendorPath('config/hyde.php'); return $this->diffConfig($config, $default);