Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix gradlew completion



Shohei YOSHIDA wrote:
> gradlew is not usually in the PATH so the command to retrieve tasks would fail
> due to 'command not found'. So it should execute './gradlew' instead of 'gradle'
> if service is gradlew and there is an executable file './gradlew' in current
> directory

Trying to run $service from a completion function is nearly always
wrong because any path prefix has first been stripped. Rather than
trying to handle the current directory, it is probably better to just
use $words[1] instead. Then if someone completes after ../gradlew or
/somewhere/else/gradlew then it will use the location they specified.
If there is no gradlew there, they're going to have other problems when
they try to execute it anyway.

Oliver




Messages sorted by: Reverse Date, Date, Thread, Author