21 lines
318 B
Go
21 lines
318 B
Go
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
|
|
}
|