This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ STATIC_FLAGS=CGO_ENABLED=0
2828
2929GIT_TAG? =$(shell git describe --tags --match "v[0-9]* ")
3030
31- LDFLAGS ="-s -w -X $(PKG_NAME ) /internal.Version=${GIT_TAG}"
31+ LDFLAGS ="-s -w -X $(PKG_NAME ) /internal.Version=${GIT_TAG} -X $( PKG_NAME ) /internal.ComposePluginVersion=2.0.0-beta.1 "
3232GO_BUILD =$(STATIC_FLAGS ) go build -trimpath -ldflags=$(LDFLAGS )
3333
3434BINARY? =bin/docker
Original file line number Diff line number Diff line change @@ -34,9 +34,10 @@ type versionOptions struct {
3434func versionCommand () * cobra.Command {
3535 opts := versionOptions {}
3636 cmd := & cobra.Command {
37- Use : "version" ,
38- Short : "Show the Docker Compose version information" ,
39- Args : cobra .MaximumNArgs (0 ),
37+ Use : "version" ,
38+ Short : "Show the Docker Compose version information" ,
39+ Args : cobra .MaximumNArgs (0 ),
40+ Hidden : true ,
4041 RunE : func (cmd * cobra.Command , _ []string ) error {
4142 runVersion (opts )
4243 return nil
@@ -51,7 +52,7 @@ func versionCommand() *cobra.Command {
5152}
5253
5354func runVersion (opts versionOptions ) {
54- displayedVersion := strings .TrimPrefix (internal .Version , "v" )
55+ displayedVersion := strings .TrimPrefix (internal .ComposePluginVersion , "v" )
5556 if opts .short {
5657 fmt .Println (displayedVersion )
5758 return
Original file line number Diff line number Diff line change @@ -26,4 +26,6 @@ const (
2626var (
2727 // Version is the version of the CLI injected in compilation time
2828 Version = "dev"
29+ // ComposePluginVersion is the version of the compose cli plugin, injected in compilation time
30+ ComposePluginVersion = "dev"
2931)
Original file line number Diff line number Diff line change @@ -61,6 +61,6 @@ func main() {
6161 manager.Metadata {
6262 SchemaVersion : "0.1.0" ,
6363 Vendor : "Docker Inc." ,
64- Version : strings .TrimPrefix (internal .Version , "v" ),
64+ Version : strings .TrimPrefix (internal .ComposePluginVersion , "v" ),
6565 })
6666}
You can’t perform that action at this time.
0 commit comments