Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Integralist
Copy link
Collaborator

Noticed some issues with how content was being rendered under specific scenarios.

@Integralist Integralist added the bug Something isn't working label Feb 23, 2023
@Integralist Integralist force-pushed the integralist/fix-build-output branch from e2779bb to 97f6173 Compare February 23, 2023 13:44
Copy link
Collaborator Author

@Integralist Integralist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments for future travellers to understand the changes in this PR.

}

if !c.overrideHost.WasSet && !c.sslCertHostname.WasSet && !c.sslSNIHostname.WasSet {
if input.Address != nil && !c.overrideHost.WasSet && !c.sslCertHostname.WasSet && !c.sslSNIHostname.WasSet {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing a nil pointer dereference bug

}

language, err := language(toolchain, c, out)
language, err := language(toolchain, c, in, out, spinner)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was related to simplifying the Toolchain interface's Build method (as we already pass a bunch of things into each language constructor, and some of the data was overlapping).

return err
}

postBuildCallback := func() error {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the order of rendering I needed to move this logic (and associated prompt functionality) inside the toolchain implementation.

wantOutput: []string{
"echo doing a post build",
"Are you sure you want to continue with the post build step?",
"Stopping the post build process",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed a redundant message that was duplicating the final error message displayed.

[scripts]
build = "touch ./bin/main.wasm"
post_build = "echo doing a post build with no confirmation prompt"`,
post_build = "echo doing a post build with no confirmation prompt && exit 1"`, // force an error so post_build is displayed to validate it was run.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now only show build/post_build output when there is an error (no need to show it if the project compiles successfully) and so we needed to fix the test to force an error so we could validate the post_build script was run.

@Integralist Integralist merged commit b8695b1 into main Feb 23, 2023
@Integralist Integralist deleted the integralist/fix-build-output branch February 23, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants