Skip to content

Commit

Permalink
Fix call to deleted method
Browse files Browse the repository at this point in the history
In commit a3231a03fa171d7e701150957ef4f6f74c2b6948 of the homebrew/brew
repository, the `Cask::Cask#versions` method was removed. We relied
on this method to compute the `formatted_version` we wish to display
to the user once the pinning is done.

To achieve the same result, we can simply call `Cask#installed_version`
instead.
  • Loading branch information
jcsanti authored and ondrejfuhrer committed Aug 18, 2023
1 parent 2afc084 commit 9cfd043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bcu/command/pin_add.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run_add_pin(cask_name)
end

formatted_cask_name = "#{Tty.green}#{cask_name}#{Tty.reset}"
formatted_version = "#{Tty.magenta}#{cask.versions.first}#{Tty.reset}"
formatted_version = "#{Tty.magenta}#{cask.installed_version}#{Tty.reset}"

puts "Pinned: #{formatted_cask_name} in version #{formatted_version}"
end
Expand Down

0 comments on commit 9cfd043

Please sign in to comment.