Skip to content

Commit

Permalink
Merge pull request #4066 from scpeters/missing_fail
Browse files Browse the repository at this point in the history
missing: exit nonzero if missing deps are found
  • Loading branch information
MikeMcQuaid committed Apr 16, 2018
2 parents 01c7df8 + 2adfb77 commit 5a2817c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Library/Homebrew/cmd/missing.rb
Expand Up @@ -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"
Expand All @@ -25,6 +27,7 @@ def missing
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
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/cmd/missing_spec.rb
Expand Up @@ -14,7 +14,7 @@ def make_prefix(name)
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
Expand All @@ -35,7 +35,7 @@ def make_prefix(name)
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
2 changes: 2 additions & 0 deletions docs/Manpage.md
Expand Up @@ -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`.

Expand Down
3 changes: 3 additions & 0 deletions manpages/brew.1
Expand Up @@ -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\.
Expand Down

0 comments on commit 5a2817c

Please sign in to comment.