Merge remote-tracking branch 'gop/main' into q

This commit is contained in:
xushiwei
2025-05-12 02:25:26 +08:00
2 changed files with 5 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
package cppkg package cppkg
import ( import (
"fmt"
"os" "os"
"os/exec" "os/exec"
"strings" "strings"
@@ -77,12 +78,14 @@ func (p *Tool) Get(quietInstall bool) (app string, err error) {
} }
func (p *Tool) getAppManager() (amPath string, install []string, err error) { func (p *Tool) getAppManager() (amPath string, install []string, err error) {
var notFoundMgs []string
for _, install = range p.installs { for _, install = range p.installs {
am := install[0] am := install[0]
if amPath, err = exec.LookPath(am); err == nil { if amPath, err = exec.LookPath(am); err == nil {
return return
} }
notFoundMgs = append(notFoundMgs, am)
} }
err = ErrNotFound err = fmt.Errorf("app managers not found: %s: %w", strings.Join(notFoundMgs, ", "), ErrNotFound)
return return
} }

View File

@@ -37,7 +37,7 @@ import (
var conanCmd = NewTool("conan", []string{ var conanCmd = NewTool("conan", []string{
"brew install conan", "brew install conan",
"apt-get install conan", "pipx install conan",
}) })
type conandata struct { type conandata struct {