mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
18 lines
307 B
Ruby
18 lines
307 B
Ruby
require 'formula'
|
|
|
|
module Homebrew
|
|
def pin
|
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
|
|
|
ARGV.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
|