24 lines
508 B
Ruby
Raw Normal View History

2016-04-08 16:28:43 +02:00
#: * `pin` <formulae>:
#: Pin the specified <formulae>, preventing them from being upgraded when
#: issuing the `brew upgrade` <formulae> command. See also `unpin`.
2016-04-08 16:28:43 +02:00
require "formula"
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
def pin
raise FormulaUnspecifiedError if ARGV.named.empty?
2015-05-17 21:06:23 +08:00
ARGV.resolved_formulae.each do |f|
if f.pinned?
opoo "#{f.name} already pinned"
elsif !f.pinnable?
onoe "#{f.name} not installed"
else
f.pin
end
end
end
end