Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed buggy weaver version output. #399

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions runtime/tool/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ func VersionCmd(tool string) *Command {
Fn: func(context.Context, []string) error {
deployerAPI := fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Patch)
codegenAPI := fmt.Sprintf("%d.%d.0", codegen.Major, codegen.Minor)
release := "?"
commit := "?"
if info, ok := debug.ReadBuildInfo(); ok {
release = info.Main.Version
for _, setting := range info.Settings {
// vcs.revision stores the commit at which the weaver tool
// was built. See [1] for more information.
Expand All @@ -50,9 +48,9 @@ func VersionCmd(tool string) *Command {
}
}
}
fmt.Printf("%s %s\n", tool, release)
fmt.Printf("target: %s/%s\n", runtime.GOOS, runtime.GOARCH)
fmt.Printf("tool: %s\n", tool)
fmt.Printf("commit: %s\n", commit)
fmt.Printf("target: %s/%s\n", runtime.GOOS, runtime.GOARCH)
fmt.Printf("deployer API: %s\n", deployerAPI)
fmt.Printf("codegen API: %s\n", codegenAPI)
return nil
Expand Down