Files
oc-deploy/src/helm/version.go

21 lines
318 B
Go
Raw Normal View History

2024-09-02 11:44:44 +00:00
package helm
import (
"strings"
"os/exec"
)
func Version(path string) (string, error) {
cmd := exec.Command(path, "version", "--short")
stdout, err := cmd.CombinedOutput()
if err != nil {
return "", err
}
res := string(stdout)
res = strings.TrimSuffix(res, "\n")
return res, nil
}