-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathversion.go
More file actions
33 lines (26 loc) · 765 Bytes
/
version.go
File metadata and controls
33 lines (26 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package commands
import (
drycc "github.com/drycc/controller-sdk-go"
"github.com/drycc/workflow-cli/pkg/settings"
"github.com/drycc/workflow-cli/version"
)
// Version prints the various CLI versions.
func (d *DryccCmd) Version(all bool) error {
if !all {
d.Println(version.Version)
return nil
}
d.Printf("Workflow CLI Version: %s\n", version.Version)
d.Printf("Workflow CLI API Version: %s\n", drycc.APIVersion)
s, err := settings.Load(d.ConfigFile)
if err != nil {
return err
}
// retrieve version information from drycc controller
err = s.Client.Healthcheck()
if err != nil && err != drycc.ErrAPIMismatch {
return err
}
d.Printf("Workflow Controller API Version: %s\n", s.Client.ControllerAPIVersion)
return nil
}