fixing could not find desired block (fixes #48) #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is being done in this PR?
The CLI now generated an application scaffold with the
appOnce.Do()
style since v0.18.9 to prevent double initialization, but we didn't update the plugins yet. This PR will fix this issue.fixes #48
What are the main choices made to get to this solution?
What was discovered while working on it? (Optional)
If you generate goth not right after the app generation but after having some resources, you need to care about the position of the goth-related lines. However, the generator just adds the lines at the end of the code block now. Move the added code to a proper location, and check the middleware stack with
buffalo task middleware
.The reason for the behavior is that
app.Resource()
duplicates theapp
as a group of endpoints, and the group, actually an app, has its own middleware stack. So if you configure goth middleware after forking the app, the forked one will not be affected by the middleware assignment.List the manual test cases you've covered before sending this PR:
buffalo plugins install /path/to/buffalo-goth
)