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