gradle / gradle-completion

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

./gradlew autocompletion gives an error #136

Open gayanper opened 1 year ago

gayanper commented 1 year ago

When trying to autocomplete when using the wrapper in the project ./gradlew it gives the following error

./gradlew _gradle:95: command not found: gradlew

This is on OS: MacOS 13 Arch: aarch64 Shell: zsh

acsdev commented 1 year ago

I am running Arch Linux with zsh and I have exactly the same problem.

When I switch to bash it works perfectly.

jdrider commented 1 year ago

I was able to fix this on Mac by adding . to my PATH as noted in the Troubleshooting section.

zsh completion using ./gradlew may not work on Linux if you don't have . on your $PATH, so I recommend adding it in your ~/.zshrc file:

kworth commented 3 months ago

I was able to fix this on Mac by adding . to my PATH as noted in the Troubleshooting section.

zsh completion using ./gradlew may not work on Linux if you don't have . on your $PATH, so I recommend adding it in your ~/.zshrc file:

@gayanper did this work for you?

gayanper commented 3 months ago

@kworth Yes the suggestion works like a charm

wwadge commented 2 months ago

Not a great idea, that opens you up to malicious code. Eg I could drop an executable called "ls" and your "." in the path would execute that one instead the one in /bin/ls