gradle / gradle-completion

Gradle tab completion for bash and zsh
MIT License
1.02k stars 131 forks source link

Bash install not working #114

Open tir38 opened 2 years ago

tir38 commented 2 years ago

I followed brew install instructions for bash completion. Tab completion is not generating any results. I also tried to manually initialize cache

cd /my/project
__gradle-completion-init
-bash: __gradle-completion-init: command not found

FWIW:

$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-apple-darwin20.6.0)
AndrewFerr commented 2 years ago

Proper installation depends on which version of bash-completion is being used. Full instructions are here: https://github.com/scop/bash-completion/#faq

What worked for me (with bash-completion-2.11-6) was to symlink gradle-completion.bash as ~/.local/share/bash-completion/completions/gradlew.

djassie commented 2 years ago

How I setup bash completion auto-completion to my CentOS-8-Stream

My Gradle location is /opt/gradle/gradle-7.4.2

1. Copy Bash-completion scripts from official release

From inside the official Gradle Completion Repo [https://github.com/gradle/gradle-completion], copy the latest gradle-completion.sh

2. Add bash completion sciripts to the /etc/bash_completion.d/gradle

  1. Create a file inside /etc/bash_completion.d/gradle or simply one liner vim command vim /etc/bash_completion.d/gradle
  2. Copy-Paste the scripts you copied from Github official latest script release.
  3. Save with wq
  4. Restart PC, you will see the Gradle Auto-completion live