-
Notifications
You must be signed in to change notification settings - Fork 967
flash: add -o flag support to save built binary (Fixes #4937) #4942
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
base: dev
Are you sure you want to change the base?
Conversation
main.go
Outdated
@@ -339,8 +339,21 @@ func dirsToModuleRootAbs(maindir, modroot string) []string { | |||
return dirs | |||
} | |||
|
|||
// validateOutputFormat checks if the output file extension matches the expected format | |||
func validateOutputFormat(outpath, expectedExt string) error { | |||
if outpath == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code checks for this condition already before calling this function, so this seems redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. That check is indeed redundant since we validate outpath before calling this function. I cleaned this up.
The macOS CI job (build-macos-14) is being canceled after running for almost 6 hours due to a timeout. Could a maintainer advise on how to proceed in this situation? |
@rdon-key can you please rebase this branch against the latest |
7394a2a
to
e11e88b
Compare
@deadprogram |
This PR adds
-o
flag support to thetinygo flash
command, allowing users to save the built binary to a specified output file. This bringsflash
in line with the behavior oftinygo build
, promoting consistency and improving usability.Fixes #4937
Changes
-o
flag support to theflash
commandvalidateOutputFormat
function to check compatibility with the target formatflash
command with usage examplesBehavior
-o
is specified, the binary is both saved and flashed.uf2
,.hex
)Testing Results