diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-11 11:15:24 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-11 11:15:24 +0800 |
| commit | 6741bc05e978676e77be06571e98a1f1eaa1d878 (patch) | |
| tree | 3df39aa67863abdf89b95ed77a6e12d52bd07a4e /main.go | |
| parent | 06dcdf457d25a707f6a25237f09a6e186173bbb7 (diff) | |
perf: cache homebrew installation check - looking for brew path takes a
significant amount of time - caching (supports XDG) brew check result to improve
performance
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -3,7 +3,6 @@ package main import ( "fmt" "os" - "os/exec" "context" "log" "github.com/fatih/color" @@ -11,14 +10,7 @@ import ( ) func main() { - // Check if Homebrew is installed - _, brewInstallationErr := exec.LookPath("brew") - if brewInstallationErr != nil { - color.Red("🍺 Homebrew not installed.") - fmt.Println("This tool is for looking up formulae/cask information about packages installed with Homebrew.") - fmt.Println("If you don't have Homebrew, it's no use.") - os.Exit(0) - } + EnsureBrewAvailable() // declare CLI app cmd := &cli.Command{ |
