Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmeiliao committed Apr 21, 2020
2 parents e05674d + 6b66097 commit 4dbe982
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package main

import (
"code.cloudfoundry.org/cli/plugin"
"fmt"
"github.com/gemfire/tanzu-gemfire-management-cf-plugin/impl/common"
"github.com/gemfire/tanzu-gemfire-management-cf-plugin/impl/common/builder"
Expand All @@ -25,8 +26,6 @@ import (
"github.com/gemfire/tanzu-gemfire-management-cf-plugin/impl/geode"
"os"
"strings"

"code.cloudfoundry.org/cli/plugin"
)

func main() {
Expand All @@ -36,16 +35,18 @@ func main() {
commonCode, err := common.NewCommandProcessor(processRequest, formatter, builder.BuildRequest)
checkError(err)

// figure out who is calling
if strings.Contains(os.Args[0], "plugins") {
basicPlugin, err := gemfire.NewBasicPlugin(commonCode)
checkError(err)
plugin.Start(basicPlugin)
} else {
// figure out who is calling. If invoked as a standalone cli
if strings.HasSuffix(os.Args[0], "main_go") ||
strings.HasSuffix(os.Args[0], "gemfire") {
geodeCommand, err := geode.New(commonCode)
checkError(err)
err = geodeCommand.Run(os.Args)
checkError(err)
// otherwise assume invoked as a plugin
} else {
basicPlugin, err := gemfire.NewBasicPlugin(commonCode)
checkError(err)
plugin.Start(basicPlugin)
}
}

Expand Down
2 changes: 1 addition & 1 deletion domain/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package domain

import "code.cloudfoundry.org/cli/plugin"

var VersionType = plugin.VersionType{Major: 1, Minor: 0, Build: 4}
var VersionType = plugin.VersionType{Major: 1, Minor: 0, Build: 5}

// CommandData is all the data involved in executing plugin commands
// This data gets manipulated throughout the program
Expand Down

0 comments on commit 4dbe982

Please sign in to comment.