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

docs: account for bash-completion in suggested script #6322

Merged
merged 1 commit into from Jul 25, 2019

Conversation

EricFromCanada
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • [n/a] Have you written new tests for your changes? Here's an example.
  • [n/a] Have you successfully run brew style with your changes locally?
  • [n/a] Have you successfully run brew tests with your changes locally?

If the bash-completion formula is installed, the completions it adds to /usr/local/etc/bash_completion.d can only be read via its bash_completion.sh script, and will error out due to missing functions if read directly. This changes the suggested script so it runs bash_completion.sh if available, and loads each file in /usr/local/etc/bash_completion.d otherwise (e.g. completions for brew and brew-services).

Note that for anyone with bash-completion installed and the suggested line from its Caveats added to their ~/.bash_profile, this script is unneccessary.

This runs the `bash-completion` initialization script if available, and loads each file in `{etc}/bash_completion.d` otherwise.
@EricFromCanada EricFromCanada requested review from a team and removed request for a team July 25, 2019 16:49
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work as usual!

@MikeMcQuaid MikeMcQuaid merged commit c8e321c into Homebrew:master Jul 25, 2019
@EricFromCanada EricFromCanada deleted the completions-code branch July 25, 2019 20:12
@lock lock bot added the outdated PR was locked due to age label Jan 1, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants