Skip to content

Commit a12f18b

Browse files
authored
Merge pull request #1834 from hydephp/experimental-yaml-config-refactor-command
Internal: Update internal config converter command
2 parents 04ce285 + d2b5002 commit a12f18b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

monorepo/DevTools/src/RefactorConfigCommand.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RefactorConfigCommand extends Command
3434
protected const SUPPORTED_FORMATS = ['yaml'];
3535

3636
/** @var string */
37-
protected $signature = 'refactor:config {format : The new configuration format}';
37+
protected $signature = 'refactor:config {format : The new configuration format} {--skip-diff : Skip diffing and dump the entire config}';
3838

3939
/** @var string */
4040
protected $description = 'Migrate the configuration to a different format.';
@@ -59,7 +59,11 @@ protected function migrateToYaml(): int
5959
{
6060
$this->ensureYamlConfigDoesNotExist();
6161

62-
$config = $this->getConfigDiff();
62+
$config = config('hyde');
63+
64+
if (! $this->option('skip-diff')) {
65+
$config = $this->getDiffedConfig($config);
66+
}
6367

6468
if (empty($config)) {
6569
$this->warn("You don't seem to have any configuration to migrate.");
@@ -84,9 +88,8 @@ protected function ensureYamlConfigDoesNotExist(): void
8488
}
8589
}
8690

87-
protected function getConfigDiff(): array
91+
protected function getDiffedConfig($config): array
8892
{
89-
$config = config('hyde');
9093
$default = require Hyde::vendorPath('config/hyde.php');
9194

9295
return $this->diffConfig($config, $default);

0 commit comments

Comments
 (0)