mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
matugen: fix app checking
- double nil for flatpak + bin required to skip
This commit is contained in:
@@ -5,6 +5,31 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type AppChecker interface {
|
||||
CommandExists(cmd string) bool
|
||||
AnyCommandExists(cmds ...string) bool
|
||||
FlatpakExists(name string) bool
|
||||
AnyFlatpakExists(flatpaks ...string) bool
|
||||
}
|
||||
|
||||
type DefaultAppChecker struct{}
|
||||
|
||||
func (DefaultAppChecker) CommandExists(cmd string) bool {
|
||||
return CommandExists(cmd)
|
||||
}
|
||||
|
||||
func (DefaultAppChecker) AnyCommandExists(cmds ...string) bool {
|
||||
return AnyCommandExists(cmds...)
|
||||
}
|
||||
|
||||
func (DefaultAppChecker) FlatpakExists(name string) bool {
|
||||
return FlatpakExists(name)
|
||||
}
|
||||
|
||||
func (DefaultAppChecker) AnyFlatpakExists(flatpaks ...string) bool {
|
||||
return AnyFlatpakExists(flatpaks...)
|
||||
}
|
||||
|
||||
func CommandExists(cmd string) bool {
|
||||
_, err := exec.LookPath(cmd)
|
||||
return err == nil
|
||||
|
||||
Reference in New Issue
Block a user