You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CommandCollection doesn't run the callback from original group #1179
We have plugins that export a click group which we pull into our command line by composing them together with a CommandCollection. However some of the plugins do important setup in their group callbacks and the CommandCollection doesn't run those.
We've fixed this by replacing the CommandCollection's callback with the group's callback in get_command. I don't know Click well enough to know if this is right but it makes sense to me.
def get_command(self, ctx, cmd_name):
for source in self.sources:
cmd = source.get_command(ctx, cmd_name)
if cmd is not None:
self.callback = source.callback
return cmd
return None
Activity
jcrotts commentedon May 7, 2019
Closing this, as I think it is a duplicate issue of #347 .
Thanks for the work around though, that is helpful. Please reopen if I have misunderstood.