From 9a96b1d7d279866a4abfb63ad58aedcb56195e37 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Fri, 7 Apr 2023 18:31:08 -0400 Subject: [PATCH] [F] Fix gradle detection --- scripts/zshrc.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/zshrc.sh b/scripts/zshrc.sh index 2aa12e9..8ef30c9 100755 --- a/scripts/zshrc.sh +++ b/scripts/zshrc.sh @@ -112,17 +112,22 @@ alias ufw="sudo ufw" alias nginx="sudo nginx" # Gradle with auto environment detection -if command -v 'gradle' &> /dev/null; then - [[ -z $GRADLE ]] && GRADLE="$(which gradle)" - gradle() { - if [[ -f "./gradlew" ]]; then - ./gradlew "$@" - else - $GRADLE "$@" - fi - } +if [[ -z $GRADLE ]]; then + if command -v 'gradle' &> /dev/null; then + GRADLE="$(which gradle)" + else + GRADLE="gradle" + fi fi +gradle() { + if [[ -f "./gradlew" ]]; then + ./gradlew "$@" + else + $GRADLE "$@" + fi +} + # Unix permissions reset (Dangerous! This will make executable files no longer executable) reset-permissions-dangerous() { sudo find . -type d -exec chmod 755 {} \;