Evanulate if cache daemon should be skipped after the flags are parsed (#4168)

pull/4202/head
Todd 2 years ago committed by Johan Brandhorst-Satzkorn
parent 8175086be7
commit 6f488d7c59

@ -42,14 +42,13 @@ func Wrap(c cacheEnabledCommand) cli.CommandFactory {
// Run runs the wrapped command and then attempts to start the boundary daemon and send
// the current persona
func (w *CommandWrapper) Run(args []string) int {
if w.BaseCommand().FlagSkipCacheDaemon {
return w.cacheEnabledCommand.Run(args)
}
// potentially intercept the token in case it isn't stored in the keyring
var token string
w.cacheEnabledCommand.BaseCommand().Opts = append(w.cacheEnabledCommand.BaseCommand().Opts, base.WithInterceptedToken(&token))
r := w.cacheEnabledCommand.Run(args)
if w.BaseCommand().FlagSkipCacheDaemon {
return r
}
if r != base.CommandSuccess {
// if we were not successful in running our command, do not continue to

Loading…
Cancel
Save