feat(cli): add check command

This commit is contained in:
Patryk Hegenberg 2025-01-31 17:56:02 +01:00
parent 3519efeccc
commit 11b8541630
14 changed files with 123 additions and 1 deletions

View file

@ -2,6 +2,8 @@ package packagemanager
import (
"fmt"
"os"
"path/filepath"
"system_setup_tool/internal/shell"
)
@ -56,3 +58,12 @@ func (c *CargoManager) UpdatePackage(pkg string) error {
func (c *CargoManager) UpdateAllPackages() error {
return fmt.Errorf("update not supported")
}
func (c *CargoManager) Check(pkg string) error {
home, err := os.UserHomeDir()
if err != nil {
return err
}
cmd := shell.ExecCommand("ls", filepath.Join(home, ".cargo", "bin", pkg))
return cmd.Run()
}