Skip to content

Commit 2f3161b

Browse files
authored
Add module version for remote github install (#66)
* add module version * add descriptors
1 parent 406d305 commit 2f3161b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cmd/tfplugingen-openapi/main.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package main
55

66
import (
7+
"fmt"
78
"io"
89
"os"
910
"runtime/debug"
@@ -18,15 +19,18 @@ import (
1819
// https://goreleaser.com/cookbooks/using-main.version/
1920
func main() {
2021
name := "tfplugingen-openapi"
21-
version := name + " commit: " + func() string {
22+
version := name + func() string {
2223
if info, ok := debug.ReadBuildInfo(); ok {
2324
for _, setting := range info.Settings {
2425
if setting.Key == "vcs.revision" {
25-
return setting.Value
26+
return fmt.Sprintf(" commit: %s", setting.Value)
2627
}
2728
}
29+
30+
return fmt.Sprintf(" module: %s", info.Main.Version)
2831
}
29-
return "local"
32+
33+
return " local"
3034
}()
3135

3236
os.Exit(runCLI(

0 commit comments

Comments
 (0)