Skip to content

Commit

Permalink
Merge pull request #96 from vadmeste/add-api
Browse files Browse the repository at this point in the history
Export IsInstalled() in install package
  • Loading branch information
posener authored Jul 2, 2019
2 parents 33efd44 + 010e7ab commit 6ffe496
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ func Install(cmd string) error {
return err
}

// IsInstalled returns true if the completion
// for the given cmd is installed.
func IsInstalled(cmd string) bool {
bin, err := getBinaryPath()
if err != nil {
return false
}

for _, i := range installers() {
installed := i.IsInstalled(cmd, bin)
if installed {
return true
}
}

return false
}

// Uninstall complete command given:
// cmd: is the command name
func Uninstall(cmd string) error {
Expand Down

0 comments on commit 6ffe496

Please sign in to comment.