2016-04-08 16:28:43 +02:00
|
|
|
#: * `tap-pin` <tap>:
|
|
|
|
#: Pin <tap>, prioritizing its formulae over core when formula names are supplied
|
|
|
|
#: by the user. See also `tap-unpin`.
|
|
|
|
|
2018-11-10 22:54:32 +05:30
|
|
|
require "cli_parser"
|
|
|
|
|
2015-08-09 22:42:46 +08:00
|
|
|
module Homebrew
|
2016-09-26 01:44:51 +02:00
|
|
|
module_function
|
|
|
|
|
2018-11-10 22:54:32 +05:30
|
|
|
def tap_pin_args
|
|
|
|
Homebrew::CLI::Parser.new do
|
|
|
|
usage_banner <<~EOS
|
|
|
|
`tap-pin` <tap>
|
|
|
|
|
|
|
|
Pin <tap>, prioritizing its formulae over core when formula names are supplied
|
|
|
|
by the user. See also `tap-unpin`.
|
|
|
|
EOS
|
|
|
|
switch :debug
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-08-09 22:42:46 +08:00
|
|
|
def tap_pin
|
2018-11-10 22:54:32 +05:30
|
|
|
tap_pin_args.parse
|
|
|
|
|
2015-08-25 17:13:37 +02:00
|
|
|
ARGV.named.each do |name|
|
2015-12-07 14:11:04 +08:00
|
|
|
tap = Tap.fetch(name)
|
2016-04-02 21:33:38 +08:00
|
|
|
raise "pinning #{tap} is not allowed" if tap.core_tap?
|
2018-09-17 02:45:00 +02:00
|
|
|
|
2015-08-09 22:42:46 +08:00
|
|
|
tap.pin
|
2016-03-07 18:08:37 +08:00
|
|
|
ohai "Pinned #{tap}"
|
2015-08-09 22:42:46 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|