feat(cli): add check command
This commit is contained in:
parent
3519efeccc
commit
11b8541630
14 changed files with 123 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue