Homebrew / homebrew-aliases

:arrow_right: Aliases for Homebrew
BSD 2-Clause "Simplified" License
153 stars 31 forks source link

Skip dirs on `brew alias` #89

Closed yermulnik closed 2 months ago

yermulnik commented 2 months ago

I've got RCS to manage local changes to Brew aliases and hence the RCS/ dir at ~/.brew-aliases/, which breaks brew alias command:

> brew alias --debug --verbose
Error: Is a directory @ io_fillbuf - fd:5 /home/yz/.brew-aliases/RCS
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/lib/aliases.rb:42:in `readlines'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/lib/aliases.rb:42:in `block in each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/lib/aliases.rb:39:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/lib/aliases.rb:39:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/lib/aliases.rb:61:in `show'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-aliases/cmd/alias.rb:42:in `run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'

Can the alias listing function be adjusted to ignore non-files/non-symlinks please?

MikeMcQuaid commented 2 months ago

Can the alias listing function be adjusted to ignore non-files/non-symlinks please?

Could you try and open a pull request? This document might help and we're happy to walk you through anything else.

Thanks!

yermulnik commented 2 months ago

@MikeMcQuaid Let me try: https://github.com/Homebrew/homebrew-aliases/pull/90