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

merge action can not work. #17

Closed
snowyu opened this issue Mar 10, 2018 · 5 comments
Closed

merge action can not work. #17

snowyu opened this issue Mar 10, 2018 · 5 comments

Comments

@snowyu
Copy link

snowyu commented Mar 10, 2018

see this branch of the addon: https://github.com/snowyu/generator-pre-commit-addon.js/tree/bug/merge

@snowyu
Copy link
Author

snowyu commented Mar 10, 2018

I have to use the writing event to manual merge deeply.

@sinedied
Copy link
Member

I just tested with your repo and commented the writing method in the branch you specified, and it worked as expected merging the package.json file?

Be careful when overriding base generator methods (prompting and writing) as you need to call the original method with super.<method> to make sure the original behaviors still works.
I'll add a note on the docs about this.

@snowyu
Copy link
Author

snowyu commented Mar 20, 2018

It's worked well after removing writing method.

But super.writing() in writing method only, It reports a confiction:

 conflict package.json

@sinedied
Copy link
Member

The original writing() method returns a promise, so you need to return it to make it work correctly:

writing() {
   return super.writing();
}

Should work the same as without the method

@snowyu
Copy link
Author

snowyu commented Mar 20, 2018

yeah, I did not expect the result to be a promise.

@snowyu snowyu closed this as completed Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants