aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/tap-pin.rb
blob: 41957f265236c7deedd0f1a14b7da8fa73a8e532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#:  * `tap-pin` <tap>:
#:    Pin <tap>, prioritizing its formulae over core when formula names are supplied
#:    by the user. See also `tap-unpin`.

require "tap"

module Homebrew
  module_function

  def tap_pin
    ARGV.named.each do |name|
      tap = Tap.fetch(name)
      raise "pinning #{tap} is not allowed" if tap.core_tap?
      tap.pin
      ohai "Pinned #{tap}"
    end
  end
end