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

feat: Added Gradle plugin #625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chriptus13
Copy link

Added Gradle plugin similar to what we have in oh-my-zsh

@@ -0,0 +1,25 @@
# Gradle plugin

This plugin adds completions and aliases for [Gradle](https://gradle.org/).
Copy link
Contributor

Choose a reason for hiding this comment

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

This plugin doesn't seem to provide completions. Is there a plan to add them?

done

# if gradlew found, run it instead of gradle
if [[ -f "$project_root/gradlew" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if [[ -f "$project_root/gradlew" ]]; then
if [[ -x "$project_root/gradlew" ]]; then


# if gradlew found, run it instead of gradle
if [[ -f "$project_root/gradlew" ]]; then
echo "executing gradlew instead of gradle"
Copy link
Contributor

Choose a reason for hiding this comment

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

In case the user pipes the commands, I think this type of informative message should go to stderr. What do you think?

Suggested change
echo "executing gradlew instead of gradle"
echo "executing gradlew instead of gradle" >&2


function gradle-or-gradlew() {
# find project root
# taken from https://github.com/gradle/gradle-completion
Copy link
Contributor

Choose a reason for hiding this comment

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

That code seems to be licensed under the MIT license, meaning that the original copyright notice should be retained. Please include it.

@akinomyoga
Copy link
Contributor

similar to what we have in oh-my-zsh

I checked the upstream OMZ plugin and realized that this PR is actually not just similar but based on the OMZ plugin. In that case, could you also mention the upstream OMZ plugin in the code comment? Since the upstream is a moving target, it is better to keep the permalink that ours is based on:

https://github.com/ohmyzsh/ohmyzsh/blob/62cf1201b031399e7251abeee859e895ee825a48/plugins/gradle/gradle.plugin.zsh

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.

2 participants