Skip to content

Commit 5a2817c

Browse files
authored
Merge pull request #4066 from scpeters/missing_fail
missing: exit nonzero if missing deps are found
2 parents 01c7df8 + 2adfb77 commit 5a2817c

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Library/Homebrew/cmd/missing.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#:
55
#: If `--hide=`<hidden> is passed, act as if none of <hidden> are installed.
66
#: <hidden> should be a comma-separated list of formulae.
7+
#:
8+
#: `missing` exits with a non-zero status if any formulae are missing dependencies.
79

810
require "formula"
911
require "tab"
@@ -25,6 +27,7 @@ def missing
2527
missing = f.missing_dependencies(hide: ARGV.values("hide"))
2628
next if missing.empty?
2729

30+
Homebrew.failed = true
2831
print "#{f}: " if ff.size > 1
2932
puts missing.join(" ")
3033
end

Library/Homebrew/test/cmd/missing_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def make_prefix(name)
1414
expect { brew "missing" }
1515
.to output("foo\n").to_stdout
1616
.and not_to_output.to_stderr
17-
.and be_a_success
17+
.and be_a_failure
1818
end
1919

2020
it "prints nothing if all dependencies are installed" do
@@ -35,7 +35,7 @@ def make_prefix(name)
3535
expect { brew "missing", "--hide=foo" }
3636
.to output("bar: foo\n").to_stdout
3737
.and not_to_output.to_stderr
38-
.and be_a_success
38+
.and be_a_failure
3939
end
4040
end
4141
end

docs/Manpage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
340340
If `--hide=``hidden` is passed, act as if none of `hidden` are installed.
341341
`hidden` should be a comma-separated list of formulae.
342342

343+
`missing` exits with a non-zero status if any formulae are missing dependencies.
344+
343345
* `options` [`--compact`] (`--all`|`--installed`|`formulae`):
344346
Display install options specific to `formulae`.
345347

manpages/brew.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ Check the given \fIformulae\fR for missing dependencies\. If no \fIformulae\fR a
346346
.IP
347347
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\.
348348
.
349+
.IP
350+
\fBmissing\fR exits with a non\-zero status if any formulae are missing dependencies\.
351+
.
349352
.TP
350353
\fBoptions\fR [\fB\-\-compact\fR] (\fB\-\-all\fR|\fB\-\-installed\fR|\fIformulae\fR)
351354
Display install options specific to \fIformulae\fR\.

0 commit comments

Comments
 (0)