This commit is contained in:
admju
2024-09-02 07:09:46 +00:00
parent 00d92b73f8
commit 4ae5926b01
40 changed files with 1711 additions and 0 deletions

20
src/helm/version.go Normal file
View File

@@ -0,0 +1,20 @@
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
}