Created
December 25, 2024 09:15
-
-
Save Aaron-212/abf9f5d9e7f2bcecc00b3ffb16e85f3e to your computer and use it in GitHub Desktop.
Nushell config for homebrew/homebrew-command-not-found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $env.config = { | |
| # ...other config... | |
| hooks: { | |
| # ...other hooks... | |
| command_not_found: { | |
| |cmd_name| ( | |
| try { | |
| let cmds = (brew which-formula $cmd_name) | |
| if ($cmds | is-empty) { | |
| return null | |
| } else { | |
| return ( | |
| $"(ansi $env.config.color_config.shape_external)($cmd_name)(ansi reset) " + | |
| $"may be found in the following brew formulae:\n($cmds)" | |
| ) | |
| } | |
| } | |
| ) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment