Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin postCmd issue #3711

Closed
tinaaliakbarpour opened this issue Oct 21, 2023 · 2 comments
Closed

Plugin postCmd issue #3711

tinaaliakbarpour opened this issue Oct 21, 2023 · 2 comments
Labels
type:bug Something isn't working

Comments

@tinaaliakbarpour
Copy link
Contributor

Hi there I was working on how to integrate wasmd with ignite and I thought that using plugins with prehooks might be a good idea (for example when we have ignite scaffold module wasmd , if you have added the new plugin it will check and run the prehook and add the wasmd functionality )but when I wanted to test the plugins and how we can use hooks with it I found an issue that I am not so sure about it. and I think the code base might have a minor bug as you can see in https://github.com/ignite/cli/blob/f3ab0d709ec41e31a1c57f2fe86c8902d8a50497/ignite/cmd/plugin.go#L236C3-L236C3

and I think this part should be replaced with this one.

if postCmd != nil {
	err := postCmd(cmd, args)
		if err != nil {
			// dont return the error, log it and let execution continue to `Run`
			return err
		}
	}

I would be happy if you could check and also would appreciate it if you have any suggestions about what I am thinking about wasmd integration.

@tinaaliakbarpour tinaaliakbarpour added the type:bug Something isn't working label Oct 21, 2023
@jeronimoalbi
Copy link
Member

Thanks for reporting the issue @tinaaliakbarpour 👍

Fix in PR #3716

Regarding the cosmwasm functionality having it in a hook triggered when ignite scaffold module wasmd is executed might not be what you want because that would actually scaffold a new module called wasmd. Hooks should be used as a "side effect" of executing an existing command.

Maybe the ideal approach is that your plugin adds a new command, for example called "cosmwasm", that could be used as ignite scaffold cosmwasm or ignite cosmwasm if you want to add more features other than scaffold.

@tinaaliakbarpour
Copy link
Contributor Author

I understand, thank you for your guidance.🙏🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants