summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-11 10:45:02 +0800
committerEltrac <hi@guhub.cn>2025-11-11 10:45:02 +0800
commit1c529909aefcdbc3c5a7be542edeaa2f1ae5e5eb (patch)
treeb63252427be4b9a4bcfb3da4f0c371a15836bdf0 /main.go
parent7487402fb90a3411b23749d489f58f22b24499f6 (diff)
fix(main.go): remove redundant lookup
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 3 insertions, 14 deletions
diff --git a/main.go b/main.go
index 9fb16e5..5f01aed 100644
--- a/main.go
+++ b/main.go
@@ -32,19 +32,8 @@ func main() {
}
pkg := args[1]
- // look up formulae
- out, brewLookupError := exec.Command("brew", "formulae", "--json=v2", pkg).Output()
- if brewLookupError != nil {
- fmt.Println("🍺 Homebrew Error:", string(out))
- os.Exit(1)
- }
-
- // parse formulae
- var formulae, cask, getformulaeErr = GetInfo(pkg)
- if getformulaeErr != nil {
- fmt.Println("Error:", getformulaeErr)
- os.Exit(1)
- }
-
+ // get formulae/cask info
+ formulae, cask := GetInfo(pkg)
+ // print info
PrintInfo(formulae, cask, pkg)
}