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

Support multiple versions of _Bash Completion_ #1915

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

gaelicWizard
Copy link
Contributor

@gaelicWizard gaelicWizard commented Aug 12, 2021

Description

On Mac OS X, where Bash as shipped is version 3.2, support loading Bash Completion version 1 or version 2 from Homebrew based on the version of the Bash shell in operation. E.g., if we're running Bash v4+, then source Bash Completion from /usr/local/opt/bash-completion@2/etc/profile.d/bash_completion.sh, but if we're running the built-in Bash v3.2, then source from /usr/local/opt/bash-completion@1/etc/bash_completion.

Motivation and Context

I want to install Bash from [Homebrew], but I alsö don't want to.

How Has This Been Tested?

Tested locally and CI passes.

Types of changes

  • New feature (non-breaking change which adds functionality)
    ...more of an optimization...

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard
Copy link
Contributor Author

I've rebased on current master.

@gaelicWizard gaelicWizard force-pushed the bash_completion branch 3 times, most recently from d163de5 to 21751d9 Compare August 26, 2021 21:02
Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

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

Looks great!
I will let others chime in if they want to 😄

For Homebrew, switch between v1 and v2 of bash-completion based on whether the running Bash shell is new enough to use v2.
@gaelicWizard
Copy link
Contributor Author

Rebased on current master.

@NoahGorny NoahGorny merged commit 9ea6002 into Bash-it:master Sep 7, 2021
@gaelicWizard gaelicWizard deleted the bash_completion branch September 9, 2021 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants