|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
3 | 3 | #
|
4 |
| -# Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. |
| 4 | +# Copyright © 2015-2021 the original authors. |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | +# |
| 18 | +# SPDX-License-Identifier: Apache-2.0 |
5 | 19 | #
|
6 | 20 |
|
7 | 21 | ##############################################################################
|
|
43 | 57 | # Darwin, MinGW, and NonStop.
|
44 | 58 | #
|
45 | 59 | # (3) This script is generated from the Groovy template
|
46 |
| -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
| 60 | +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt |
47 | 61 | # within the Gradle project.
|
48 | 62 | #
|
49 | 63 | # You can find Gradle at https://github.com/gradle/gradle/.
|
|
71 | 85 | # This is normally unused
|
72 | 86 | # shellcheck disable=SC2034
|
73 | 87 | APP_BASE_NAME=${0##*/}
|
74 |
| -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit |
| 88 | +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
| 89 | +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s |
| 90 | +' "$PWD" ) || exit |
75 | 91 |
|
76 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value.
|
77 | 93 | MAX_FD=maximum
|
@@ -132,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
132 | 148 | case $MAX_FD in #(
|
133 | 149 | max*)
|
134 | 150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
135 |
| - # shellcheck disable=SC3045 |
| 151 | + # shellcheck disable=SC2039,SC3045 |
136 | 152 | MAX_FD=$( ulimit -H -n ) ||
|
137 | 153 | warn "Could not query maximum file descriptor limit"
|
138 | 154 | esac
|
139 | 155 | case $MAX_FD in #(
|
140 | 156 | '' | soft) :;; #(
|
141 | 157 | *)
|
142 | 158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
143 |
| - # shellcheck disable=SC3045 |
| 159 | + # shellcheck disable=SC2039,SC3045 |
144 | 160 | ulimit -n "$MAX_FD" ||
|
145 | 161 | warn "Could not set maximum file descriptor limit to $MAX_FD"
|
146 | 162 | esac
|
|
189 | 205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
190 | 206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
191 | 207 |
|
192 |
| -# Collect all arguments for the java command; |
193 |
| -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of |
194 |
| -# shell script including quotes and variable substitutions, so put them in |
195 |
| -# double quotes to make sure that they get re-expanded; and |
196 |
| -# * put everything else in single quotes, so that it's not re-expanded. |
| 208 | +# Collect all arguments for the java command: |
| 209 | +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, |
| 210 | +# and any embedded shellness will be escaped. |
| 211 | +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be |
| 212 | +# treated as '${Hostname}' itself on the command line. |
197 | 213 |
|
198 | 214 | set -- \
|
199 | 215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
0 commit comments