Skip to content

Commit

Permalink
Merge pull request #108 from TIBCOSoftware/update-to-versioncommand
Browse files Browse the repository at this point in the history
Update to version command
  • Loading branch information
retgits authored Jun 1, 2018
2 parents 80636ce + d6594de commit a427716
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ func (c *cmdVersion) AddFlags(fs *flag.FlagSet) {
func (c *cmdVersion) Exec(args []string) error {

cmd := exec.Command("git", "describe", "--tags")
cmd.Dir = filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "TIBCOSoftware", "flogo-cli")
gopath, set := os.LookupEnv("GOPATH")
if !set {
out, err := exec.Command("go", "env", "GOPATH").Output()
if err != nil {
log.Fatal(err)
}
gopath = strings.TrimSuffix(string(out), "\n")
}
cmd.Dir = filepath.Join(gopath, "src", "github.com", "TIBCOSoftware", "flogo-cli")
cmd.Env = append(os.Environ())

out, err := cmd.Output()
Expand Down

0 comments on commit a427716

Please sign in to comment.