mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Exit non-zero when pinning uninstalled formula
This commit is contained in:
parent
b57557dc3d
commit
f4bcda325a
@ -23,9 +23,9 @@ module Homebrew
|
|||||||
def run
|
def run
|
||||||
args.named.to_resolved_formulae.each do |f|
|
args.named.to_resolved_formulae.each do |f|
|
||||||
if f.pinned?
|
if f.pinned?
|
||||||
opoo "#{f.name} already pinned"
|
ofail "#{f.name} already pinned"
|
||||||
elsif !f.pinnable?
|
elsif !f.pinnable?
|
||||||
onoe "#{f.name} not installed"
|
ofail "#{f.name} not installed"
|
||||||
else
|
else
|
||||||
f.pin
|
f.pin
|
||||||
end
|
end
|
||||||
|
@ -11,4 +11,10 @@ RSpec.describe Homebrew::Cmd::Pin do
|
|||||||
|
|
||||||
expect { brew "pin", "testball" }.to be_a_success
|
expect { brew "pin", "testball" }.to be_a_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "fails with an uninstalled Formula", :integration_test do
|
||||||
|
setup_test_formula "testball"
|
||||||
|
|
||||||
|
expect { brew "pin", "testball" }.to be_a_failure
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user