getAppManager: rm notFoundMgs

This commit is contained in:
xushiwei
2025-05-12 02:26:46 +08:00
parent 19056b8a19
commit 26b997537f

View File

@@ -17,7 +17,6 @@
package cppkg package cppkg
import ( import (
"fmt"
"os" "os"
"os/exec" "os/exec"
"strings" "strings"
@@ -78,14 +77,12 @@ 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 = fmt.Errorf("app managers not found: %s: %w", strings.Join(notFoundMgs, ", "), ErrNotFound) err = ErrNotFound
return return
} }