|
55 | 55 | # Darwin, MinGW, and NonStop. |
56 | 56 | # |
57 | 57 | # (3) This script is generated from the Groovy template |
58 | | -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
| 58 | +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
59 | 59 | # within the Gradle project. |
60 | 60 | # |
61 | 61 | # You can find Gradle at https://github.com/gradle/gradle/. |
|
83 | 83 | # This is normally unused |
84 | 84 | # shellcheck disable=SC2034 |
85 | 85 | APP_BASE_NAME=${0##*/} |
| 86 | +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
86 | 87 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit |
87 | 88 |
|
88 | 89 | if [ ! -e $APP_HOME/gradle/wrapper/gradle-wrapper.jar ]; then |
89 | | - curl -o $APP_HOME/gradle/wrapper/gradle-wrapper.jar https://raw.githubusercontent.com/gradle/gradle/v8.1.1/gradle/wrapper/gradle-wrapper.jar |
| 90 | + curl -o $APP_HOME/gradle/wrapper/gradle-wrapper.jar https://raw.githubusercontent.com/gradle/gradle/v8.8.0/gradle/wrapper/gradle-wrapper.jar |
90 | 91 | fi |
91 | 92 |
|
92 | 93 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
@@ -134,26 +135,29 @@ location of your Java installation." |
134 | 135 | fi |
135 | 136 | else |
136 | 137 | JAVACMD=java |
137 | | - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
| 138 | + if ! command -v java >/dev/null 2>&1 |
| 139 | + then |
| 140 | + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
138 | 141 |
|
139 | 142 | Please set the JAVA_HOME variable in your environment to match the |
140 | 143 | location of your Java installation." |
| 144 | + fi |
141 | 145 | fi |
142 | 146 |
|
143 | 147 | # Increase the maximum file descriptors if we can. |
144 | 148 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then |
145 | 149 | case $MAX_FD in #( |
146 | 150 | max*) |
147 | 151 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. |
148 | | - # shellcheck disable=SC3045 |
| 152 | + # shellcheck disable=SC2039,SC3045 |
149 | 153 | MAX_FD=$( ulimit -H -n ) || |
150 | 154 | warn "Could not query maximum file descriptor limit" |
151 | 155 | esac |
152 | 156 | case $MAX_FD in #( |
153 | 157 | '' | soft) :;; #( |
154 | 158 | *) |
155 | 159 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. |
156 | | - # shellcheck disable=SC3045 |
| 160 | + # shellcheck disable=SC2039,SC3045 |
157 | 161 | ulimit -n "$MAX_FD" || |
158 | 162 | warn "Could not set maximum file descriptor limit to $MAX_FD" |
159 | 163 | esac |
|
202 | 206 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
203 | 207 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
204 | 208 |
|
205 | | -# Collect all arguments for the java command; |
206 | | -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of |
207 | | -# shell script including quotes and variable substitutions, so put them in |
208 | | -# double quotes to make sure that they get re-expanded; and |
209 | | -# * put everything else in single quotes, so that it's not re-expanded. |
| 209 | +# Collect all arguments for the java command: |
| 210 | +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, |
| 211 | +# and any embedded shellness will be escaped. |
| 212 | +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be |
| 213 | +# treated as '${Hostname}' itself on the command line. |
210 | 214 |
|
211 | 215 | set -- \ |
212 | 216 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ |
|
0 commit comments