missing: exit nonzero if missing deps are found

This commit is contained in:
Steven Peters 2018-04-12 22:35:51 -07:00
parent 50059990e2
commit 2adfb77cd8
4 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,8 @@
#:
#: If `--hide=`<hidden> is passed, act as if none of <hidden> are installed.
#: <hidden> should be a comma-separated list of formulae.
#:
#: `missing` exits with a non-zero status if any formulae are missing dependencies.
require "formula"
require "tab"
@ -25,6 +27,7 @@ module Homebrew
missing = f.missing_dependencies(hide: ARGV.values("hide"))
next if missing.empty?
Homebrew.failed = true
print "#{f}: " if ff.size > 1
puts missing.join(" ")
end

View File

@ -14,7 +14,7 @@ describe "brew missing", :integration_test do
expect { brew "missing" }
.to output("foo\n").to_stdout
.and not_to_output.to_stderr
.and be_a_success
.and be_a_failure
end
it "prints nothing if all dependencies are installed" do
@ -35,7 +35,7 @@ describe "brew missing", :integration_test do
expect { brew "missing", "--hide=foo" }
.to output("bar: foo\n").to_stdout
.and not_to_output.to_stderr
.and be_a_success
.and be_a_failure
end
end
end

View File

@ -340,6 +340,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--hide=``hidden` is passed, act as if none of `hidden` are installed.
`hidden` should be a comma-separated list of formulae.
`missing` exits with a non-zero status if any formulae are missing dependencies.
* `options` [`--compact`] (`--all`|`--installed`|`formulae`):
Display install options specific to `formulae`.

View File

@ -346,6 +346,9 @@ Check the given \fIformulae\fR for missing dependencies\. If no \fIformulae\fR a
.IP
If \fB\-\-hide=\fR\fIhidden\fR is passed, act as if none of \fIhidden\fR are installed\. \fIhidden\fR should be a comma\-separated list of formulae\.
.
.IP
\fBmissing\fR exits with a non\-zero status if any formulae are missing dependencies\.
.
.TP
\fBoptions\fR [\fB\-\-compact\fR] (\fB\-\-all\fR|\fB\-\-installed\fR|\fIformulae\fR)
Display install options specific to \fIformulae\fR\.