From 26c7fedfec04d47e39b4109f534bcac57ad3da3b Mon Sep 17 00:00:00 2001 From: traviolus <42636319+traviolus@users.noreply.github.com> Date: Thu, 14 May 2026 15:30:42 +0700 Subject: [PATCH] fix(launchtools): bind start flags to viper directly --- contrib/launchtools/steps/runapp.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/launchtools/steps/runapp.go b/contrib/launchtools/steps/runapp.go index 12f38c03..ea640290 100644 --- a/contrib/launchtools/steps/runapp.go +++ b/contrib/launchtools/steps/runapp.go @@ -75,10 +75,11 @@ func RunAppWithPostAction(postAction launchtools.PostAction) func(cfg *launchtoo // set relevant context; this part is necessary to correctly set up the start command and their start-up flags startCmd.SetContext(ctx.Context()) - // Run PreRunE from startCmd. This step is necessary to correctly set up start-up flags, - // as it is done usually with cometbft start command. - if err := startCmd.PreRunE(startCmd, nil); err != nil { - return errors.Wrapf(err, "failed to prerun command") + // Bind start-cmd flags to the server context's viper so RunE can read them. + // On cosmos-sdk v0.50 this was done by startCmd.PreRunE, on v0.53 PreRunE was + // removed. So here we just bypass by constructing startCmd directly. + if err := ctx.ServerContext().Viper.BindPFlags(startCmd.Flags()); err != nil { + return errors.Wrapf(err, "failed to bind start flags to viper") } // Run RunE command - this part fires up the actual chain