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

fix: optionally load bash completion for npm and nvm, fixes #6106 #6294

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

stasadev
Copy link
Member

The Issue

ddev npm completions don't work.

How This PR Solves The Issue

Adds an optional check if the completion function is available, if not: load it again.
I did the same for nvm just in case.

Manual Testing Instructions

ddev npm <tab><tab>

Automated Testing Overview

Release/Deployment Notes

@stasadev stasadev requested a review from a team as a code owner June 10, 2024 09:58
Copy link

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

I think this is as good as it gets.

I don't like all the things it returns sometimes, like ddev npm in <tab>:

$ npm in
in               innit            insta            install-ci-test
info             ins              instal           install-clean
init             inst             install          install-test

But I think those are all a result of npm's behavior. Not sure where ins and inst and instal come from, but I guess super-ambitious npm autocomplete.

nvm looks great.

@stasadev
Copy link
Member Author

Not sure where ins and inst and instal come from

I'm sure developers are tired of typing the full command, or they may type it with errors, and get angry when it doesn't work.

I myself use aliases like stop for ddev stop, and I make typing mistakes, so for this particular case I have:

alias stop="ddev stop"
alias stio="stop"
alias stp\[="stop"
alias sotp="stop"

And I keep typing it wrong, but now it works no matter what 😅

@rfay rfay merged commit 861d9ee into ddev:master Jun 12, 2024
20 checks passed
@stasadev stasadev deleted the 20240610_stasadev_npm_completion branch June 12, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants