Skip to content

fix: embed instructions files & show error during show sdk step#174

Merged
k3llymariee merged 5 commits into
mainfrom
kelly/return-error-during-show-sdk-step
Apr 16, 2024
Merged

fix: embed instructions files & show error during show sdk step#174
k3llymariee merged 5 commits into
mainfrom
kelly/return-error-during-show-sdk-step

Conversation

@k3llymariee
Copy link
Copy Markdown
Contributor

@k3llymariee k3llymariee commented Apr 12, 2024

The new instruction files weren't readable from the binary, so now we are embedding them!

Also this error was getting swallowed, resulting in an infinite spinner, so if something goes wrong with reading the file (or fetching the env) we'll now surface that too.

image


if m.instructions == "" || m.environment == nil {
return m.spinner.View() + fmt.Sprintf(" Fetching %s SDK instructions...", m.displayName)
return m.spinner.View() + fmt.Sprintf(" Fetching %s SDK instructions...\n", m.displayName) + footerView(m.help.View(m.helpKeys), nil)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added the footer view here as well

PaddingRight(2)

h := help.New()
h.ShowAll = true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

only showing full help when showing the instructions

Comment thread internal/sdks/sdks.go
Comment on lines +9 to +11
//go:embed sdk_instructions/*.md
var InstructionFiles embed.FS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

main change

@k3llymariee k3llymariee marked this pull request as ready for review April 12, 2024 23:36
@k3llymariee k3llymariee requested review from dbolson and sunnyguduru and removed request for dbolson April 12, 2024 23:36
@sunnyguduru
Copy link
Copy Markdown

Do we have to run 'go generate' or something similar now?

@k3llymariee
Copy link
Copy Markdown
Contributor Author

Do we have to run 'go generate' or something similar now?

nope shouldn't have to!

@k3llymariee k3llymariee merged commit ae07b46 into main Apr 16, 2024
@k3llymariee k3llymariee deleted the kelly/return-error-during-show-sdk-step branch April 16, 2024 15:45
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

Successfully merging this pull request may close these issues.

3 participants