buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.39k stars 89 forks source link

Issues with brew cu pin commands #233

Closed hao-lh closed 6 months ago

hao-lh commented 1 year ago

Hello,

Thanks for maintain this excellent tool, which allow use to manage all homecask applications in a single shot. I encountered two issues while with brew cu pin command during the process.

  1. To prevent some applications from future upgrade. However, when I run brew cu pin for the 1st time, it would give following errors. 2nd run of the same command is OK.

brew cu pin sourcetree Error: undefined method versions' for #<Cask::Cask:0x00007ff8f7aa18b8> /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_add.rb:39:inrun_add_pin' /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_add.rb:19:in add_pin' /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_add.rb:13:inprocess' /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:25:in process' /usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:75:in<top (required)>' /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:10:in require' /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:10:inrequire?' /usr/local/Homebrew/Library/Homebrew/brew.rb:96:in `

'

brew cu pin sourcetree Already pinned: sourcetree

  1. sometimes we use brew cu pin A B C D to batch process such requirements, however, seemed only 1st A would take effect, other B/C/D would be omitted during this process.

Could you help further check with above two issues? Thanks.

ondrejfuhrer commented 1 year ago
  1. This is a duplicate for https://github.com/buo/homebrew-cask-upgrade/issues/231 , caused by changes in brew itself.

  2. Multiple casks for pin command is not supported, but you're right that it might make sense to be consistent with this as other commands support it.

hao-lh commented 1 year ago

Thanks @ondrejfuhrer for your comments.

ondrejfuhrer commented 10 months ago

I assume this was fixed by https://github.com/buo/homebrew-cask-upgrade/pull/236 ? Can you confirm, @hao-lh ?

qartik commented 10 months ago

@ondrejfuhrer brew cu pinned still fails:

homebrew-cask-upgrade on  master
❯ git describe
v2.0.0-235-g9cfd043
❯ brew cu pinned
Error: undefined method `versions' for #<Cask microsoft-edge>
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:189:in `block in output_print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `each'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `each_with_index'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `output_print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:171:in `print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_list.rb:20:in `list_pinned'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_list.rb:9:in `process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:25:in `process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:75:in `<top (required)>'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require?'
/opt/homebrew/Library/Homebrew/brew.rb:96:in `<main>'

homebrew-cask-upgrade on  master
❯ brew cu unpin microsoft-edge
Unpinned: microsoft-edge
❯ brew cu pin microsoft-edge
Pinned: microsoft-edge in version 113.0.1774.35
hao-lh commented 10 months ago

I assume this was fixed by #236 ? Can you confirm, @hao-lh ?

Hi @ondrejfuhrer, did you mean 1st issue or 2nd one?

I tested 2nd one with multiple chain input, only 1st one would take effect as before.

brew cu unpin zoom pycharm Unpinned: zoom

ondrejfuhrer commented 8 months ago

I assume this was fixed by #236 ? Can you confirm, @hao-lh ?

Hi @ondrejfuhrer, did you mean 1st issue or 2nd one?

I tested 2nd one with multiple chain input, only 1st one would take effect as before.

brew cu unpin zoom pycharm

Unpinned: zoom

Yes, there is only single cask supported.

ondrejfuhrer commented 6 months ago

@ondrejfuhrer brew cu pinned still fails:

homebrew-cask-upgrade on  master
❯ git describe
v2.0.0-235-g9cfd043
❯ brew cu pinned
Error: undefined method `versions' for #<Cask microsoft-edge>
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:189:in `block in output_print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `each'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `each_with_index'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:185:in `output_print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/formatter.rb:171:in `print_pin_table'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_list.rb:20:in `list_pinned'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/pin_list.rb:9:in `process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:25:in `process'
/opt/homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:75:in `<top (required)>'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:10:in `require?'
/opt/homebrew/Library/Homebrew/brew.rb:96:in `<main>'

homebrew-cask-upgrade on  master
❯ brew cu unpin microsoft-edge
Unpinned: microsoft-edge
❯ brew cu pin microsoft-edge
Pinned: microsoft-edge in version 113.0.1774.35

Sorry for delayed answer, this should be fixed.