mirror of
https://gitee.com/dcren/initializr.git
synced 2025-05-03 20:28:01 +08:00
Use .zip distro for installer
This commit is contained in:
parent
c229e971d9
commit
6018dd74be
@ -8,13 +8,13 @@ if [ -z "${PREFIX}" ]; then
|
||||
PREFIX="/usr/local/bin"
|
||||
fi
|
||||
if [ -z "${JAR_FILE}" ]; then
|
||||
JAR_FILE="/tmp/spring.jar"
|
||||
JAR_FILE="/tmp/spring.zip"
|
||||
if [ -z "${JAR_URL}" ]; then
|
||||
|
||||
echo "Downloading spring ${VERSION} distribution"
|
||||
echo
|
||||
|
||||
JAR_URL="https://repo.springsource.org/milestone/org/springframework/boot/spring-boot-cli/${VERSION}/spring-boot-cli-${VERSION}.jar"
|
||||
JAR_URL="https://repo.springsource.org/milestone/org/springframework/boot/spring-boot-cli/${VERSION}/spring-boot-cli-${VERSION}-dist.zip"
|
||||
curl --progress-bar --fail "$JAR_URL" -o "$JAR_FILE"
|
||||
|
||||
fi
|
||||
@ -23,26 +23,26 @@ trap "echo Installation failed." EXIT
|
||||
|
||||
test -f "${JAR_FILE}"
|
||||
|
||||
SPRING_HOME="${HOME}/.spring"
|
||||
mkdir -p "$SPRING_HOME"
|
||||
cp "$JAR_FILE" "${SPRING_HOME}/spring.jar"
|
||||
if [ -z "${SPRING_HOME}" ]; then
|
||||
SPRING_HOME="${HOME}/.spring"
|
||||
fi
|
||||
|
||||
mkdir -p "${SPRING_HOME}"
|
||||
cd "${SPRING_HOME}"
|
||||
rm -rf spring* bin lib
|
||||
unzip -o "$JAR_FILE"
|
||||
mv spring*/* .
|
||||
rm -rf spring*
|
||||
echo
|
||||
|
||||
rm -rf "${SPRING_HOME}"/spring
|
||||
cat > "${SPRING_HOME}"/spring <<"EOF"
|
||||
#!/bin/sh
|
||||
java -jar ${SPRING_HOME}/spring.jar \$*
|
||||
EOF
|
||||
chmod +x "${SPRING_HOME}/spring"
|
||||
test -x "${SPRING_HOME}/spring"
|
||||
test -x "${SPRING_HOME}/bin/spring"
|
||||
|
||||
echo "spring ${VERSION} has been installed in your home directory (~/.spring)."
|
||||
echo
|
||||
|
||||
if rm -f "$PREFIX/spring" && ln -sf "${SPRING_HOME}/spring" "$PREFIX/spring" >/dev/null 2>&1; then
|
||||
if rm -f "$PREFIX/spring" && ln -sf "${SPRING_HOME}/bin/spring" "$PREFIX/spring" >/dev/null 2>&1; then
|
||||
echo
|
||||
echo "Linking ~/.spring/spring to $PREFIX/spring for your convenience."
|
||||
echo "Linking ${SPRING_HOME}/bin/spring to $PREFIX/spring for your convenience."
|
||||
cat <<"EOF"
|
||||
|
||||
To get started:
|
||||
@ -54,9 +54,9 @@ And take a look at the README at https://github.com/springsource/spring-boot#rea
|
||||
|
||||
EOF
|
||||
elif type sudo >/dev/null 2>&1; then
|
||||
echo "Linking ~/.spring/spring to $PREFIX/spring for your convenience."
|
||||
echo "Linking ${SPRING_HOME}/bin/spring to $PREFIX/spring for your convenience."
|
||||
echo "This may prompt for your password."
|
||||
if sudo rm -f "$PREFIX/spring" && sudo ln -sf "${SPRING_HOME}/spring" "$PREFIX/spring" >/dev/null 2>&1; then
|
||||
if sudo rm -f "$PREFIX/spring" && sudo ln -sf "${SPRING_HOME}/bin/spring" "$PREFIX/spring" >/dev/null 2>&1; then
|
||||
cat <<"EOF"
|
||||
|
||||
To get started:
|
||||
@ -71,8 +71,8 @@ EOF
|
||||
cat <<"EOF"
|
||||
Couldn't create the symlink. Please either:
|
||||
(1) Run the following as root:
|
||||
cp ~/.spring/spring /usr/bin/spring
|
||||
(2) Add ~/.spring to your path, or
|
||||
cp ${SPRING_HOME}/bin/spring /usr/bin/spring
|
||||
(2) Add ${SPRING_HOME}/bin to your path, or
|
||||
(3) Rerun this command to try again.
|
||||
|
||||
Then to get started, take a look at 'spring help' or see the README at
|
||||
@ -86,7 +86,7 @@ Now you need to do one of the following:
|
||||
|
||||
(1) Add ~/.spring to your path, or
|
||||
(2) Run this command as root:
|
||||
cp ~/.spring/spring /usr/bin/spring
|
||||
cp ${SPRING_HOME}/bin /usr/bin/spring
|
||||
|
||||
Then to get started, take a look at 'spring help' or see the README at
|
||||
https://github.com/springsource/spring-boot#readme.
|
||||
|
Loading…
Reference in New Issue
Block a user