20 lines
595 B
Bash
Executable File
20 lines
595 B
Bash
Executable File
#!/usr/bin/env sh
|
|
set -eu
|
|
|
|
ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
PROPS="$ROOT_DIR/gradle/wrapper/gradle-wrapper.properties"
|
|
|
|
DIST_URL=$(grep '^distributionUrl=' "$PROPS" | cut -d= -f2- | sed 's#\\:#:#g')
|
|
TMP_ZIP="/tmp/gradle-dist.zip"
|
|
TMP_DIR="/tmp/gradle-dist"
|
|
rm -rf "$TMP_DIR" "$TMP_ZIP"
|
|
mkdir -p "$TMP_DIR"
|
|
curl -fsSL "$DIST_URL" -o "$TMP_ZIP"
|
|
unzip -q "$TMP_ZIP" -d "$TMP_DIR"
|
|
GRADLE_BIN=$(find "$TMP_DIR" -type f -path '*/bin/gradle' | head -1)
|
|
if [ -z "$GRADLE_BIN" ]; then
|
|
echo "Could not locate gradle binary in distribution" >&2
|
|
exit 1
|
|
fi
|
|
exec "$GRADLE_BIN" "$@"
|