mirror of https://github.com/docker/compose.git
Merge pull request #1603 from gtardif/compose-cli-plugin-version
Separate compose CLI plugin version from Cloud integration version
This commit is contained in:
commit
38b4220bdb
|
@ -28,7 +28,7 @@ STATIC_FLAGS=CGO_ENABLED=0
|
|||
|
||||
GIT_TAG?=$(shell git describe --tags --match "v[0-9]*")
|
||||
|
||||
LDFLAGS="-s -w -X $(PKG_NAME)/internal.Version=${GIT_TAG}"
|
||||
LDFLAGS="-s -w -X $(PKG_NAME)/internal.Version=${GIT_TAG} -X $(PKG_NAME)/internal.ComposePluginVersion=2.0.0-beta.1"
|
||||
GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS)
|
||||
|
||||
BINARY?=bin/docker
|
||||
|
|
|
@ -34,9 +34,10 @@ type versionOptions struct {
|
|||
func versionCommand() *cobra.Command {
|
||||
opts := versionOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Show the Docker Compose version information",
|
||||
Args: cobra.MaximumNArgs(0),
|
||||
Use: "version",
|
||||
Short: "Show the Docker Compose version information",
|
||||
Args: cobra.MaximumNArgs(0),
|
||||
Hidden: true,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
runVersion(opts)
|
||||
return nil
|
||||
|
@ -51,7 +52,7 @@ func versionCommand() *cobra.Command {
|
|||
}
|
||||
|
||||
func runVersion(opts versionOptions) {
|
||||
displayedVersion := strings.TrimPrefix(internal.Version, "v")
|
||||
displayedVersion := strings.TrimPrefix(internal.ComposePluginVersion, "v")
|
||||
if opts.short {
|
||||
fmt.Println(displayedVersion)
|
||||
return
|
||||
|
|
|
@ -26,4 +26,6 @@ const (
|
|||
var (
|
||||
// Version is the version of the CLI injected in compilation time
|
||||
Version = "dev"
|
||||
// ComposePluginVersion is the version of the compose cli plugin, injected in compilation time
|
||||
ComposePluginVersion = "dev"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue