diff --git a/cmd/mirror/mirror.go b/cmd/mirror/mirror.go index 3e4902ca7d..69e830658a 100644 --- a/cmd/mirror/mirror.go +++ b/cmd/mirror/mirror.go @@ -34,6 +34,10 @@ Order of execution: 3. mirror event store tables 4. recompute projections 5. verify`, + PersistentPreRun: func(cmd *cobra.Command, args []string) { + err := viper.MergeConfig(bytes.NewBuffer(defaultConfig)) + logging.OnError(err).Fatal("unable to read default config") + }, Run: func(cmd *cobra.Command, args []string) { config := mustNewMigrationConfig(viper.GetViper()) projectionConfig := mustNewProjectionsConfig(viper.GetViper()) @@ -59,9 +63,6 @@ Order of execution: The flag should be provided if you want to execute the mirror command multiple times so that the static data are also mirrored to prevent inconsistent states.`) migrateProjectionsFlags(cmd) - err := viper.MergeConfig(bytes.NewBuffer(defaultConfig)) - logging.OnError(err).Fatal("unable to read default config") - cmd.AddCommand( eventstoreCmd(), systemCmd(),