[F] Fix gradle detection

This commit is contained in:
Azalea Gui
2023-04-07 18:31:08 -04:00
parent cbbaa28280
commit 9a96b1d7d2
+14 -9
View File
@@ -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 {} \;