File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,6 @@ func newMigrateCommand(log logutils.Log, info BuildInfo) *migrateCommand {
8181}
8282
8383func (c * migrateCommand ) execute (_ * cobra.Command , _ []string ) error {
84- if c .cfg .Version != "" {
85- return fmt .Errorf ("configuration version is already set: %s" , c .cfg .Version )
86- }
87-
8884 srcPath := c .viper .ConfigFileUsed ()
8985 if srcPath == "" {
9086 c .log .Warnf ("No config file detected" )
@@ -141,6 +137,10 @@ func (c *migrateCommand) preRunE(cmd *cobra.Command, _ []string) error {
141137 return fmt .Errorf ("unsupported format: %s" , c .opts .format )
142138 }
143139
140+ if c .cfg .Version != "" {
141+ return fmt .Errorf ("configuration version is already set: %s" , c .cfg .Version )
142+ }
143+
144144 if c .opts .skipValidation {
145145 return nil
146146 }
You can’t perform that action at this time.
0 commit comments