Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/shellenv: use Bash. #4887

Merged
merged 1 commit into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 0 additions & 16 deletions Library/Homebrew/cmd/shellenv.rb

This file was deleted.

18 changes: 18 additions & 0 deletions Library/Homebrew/cmd/shellenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#: * `shellenv`:
#: Prints export statements - run them in a shell and this installation of
#: Homebrew will be included into your PATH, MANPATH, and INFOPATH.
#:
#: HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported
#: to save multiple queries of those variables.
#:
#: Consider adding evaluating the output in your dotfiles (e.g. `~/.profile`)
#: with `eval $(brew shellenv)`

homebrew-shellenv() {
echo "export HOMEBREW_PREFIX=\"$HOMEBREW_PREFIX\""
echo "export HOMEBREW_CELLAR=\"$HOMEBREW_CELLAR\""
echo "export HOMEBREW_REPOSITORY=\"$HOMEBREW_REPOSITORY\""
echo "export PATH=\"$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin:\$PATH\""
echo "export MANPATH=\"$HOMEBREW_PREFIX/share/man:\$MANPATH\""
echo "export INFOPATH=\"$HOMEBREW_PREFIX/share/info:\$INFOPATH\""
}
8 changes: 0 additions & 8 deletions Library/Homebrew/test/cmd/shellenv_spec.rb

This file was deleted.

7 changes: 6 additions & 1 deletion docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,12 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
* `shellenv`:
Prints export statements - run them in a shell and this installation of
Homebrew will be included into your PATH, MANPATH, and INFOPATH.
Tip: have your dotfiles eval the output of this command

HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported
to save multiple queries of those variables.

Consider adding evaluating the output in your dotfiles (e.g. `~/.profile`)
with `eval $(brew shellenv)`

* `style` [`--fix`] [`--display-cop-names`] [`--only-cops=``cops`|`--except-cops=``cops`] [`files`|`taps`|`formulae`]:
Check formulae or files for conformance to Homebrew style guidelines.
Expand Down
8 changes: 7 additions & 1 deletion manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,13 @@ If \fB\-\-desc\fR is passed, search formulae with a description matching \fItext
If \fB\-\-env=std\fR is passed, use the standard \fBPATH\fR instead of superenv\'s\.
.
.IP "\(bu" 4
\fBshellenv\fR: Prints export statements \- run them in a shell and this installation of Homebrew will be included into your PATH, MANPATH, and INFOPATH\. Tip: have your dotfiles eval the output of this command
\fBshellenv\fR: Prints export statements \- run them in a shell and this installation of Homebrew will be included into your PATH, MANPATH, and INFOPATH\.
.
.IP
HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to save multiple queries of those variables\.
.
.IP
Consider adding evaluating the output in your dotfiles (e\.g\. \fB~/\.profile\fR) with \fBeval $(brew shellenv)\fR
.
.IP "\(bu" 4
\fBstyle\fR [\fB\-\-fix\fR] [\fB\-\-display\-cop\-names\fR] [\fB\-\-only\-cops=\fR\fIcops\fR|\fB\-\-except\-cops=\fR\fIcops\fR] [\fIfiles\fR|\fItaps\fR|\fIformulae\fR]: Check formulae or files for conformance to Homebrew style guidelines\.
Expand Down