mirror of
https://gitee.com/dcren/initializr.git
synced 2025-05-04 12:48:02 +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"
|
PREFIX="/usr/local/bin"
|
||||||
fi
|
fi
|
||||||
if [ -z "${JAR_FILE}" ]; then
|
if [ -z "${JAR_FILE}" ]; then
|
||||||
JAR_FILE="/tmp/spring.jar"
|
JAR_FILE="/tmp/spring.zip"
|
||||||
if [ -z "${JAR_URL}" ]; then
|
if [ -z "${JAR_URL}" ]; then
|
||||||
|
|
||||||
echo "Downloading spring ${VERSION} distribution"
|
echo "Downloading spring ${VERSION} distribution"
|
||||||
echo
|
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"
|
curl --progress-bar --fail "$JAR_URL" -o "$JAR_FILE"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -23,26 +23,26 @@ trap "echo Installation failed." EXIT
|
|||||||
|
|
||||||
test -f "${JAR_FILE}"
|
test -f "${JAR_FILE}"
|
||||||
|
|
||||||
SPRING_HOME="${HOME}/.spring"
|
if [ -z "${SPRING_HOME}" ]; then
|
||||||
mkdir -p "$SPRING_HOME"
|
SPRING_HOME="${HOME}/.spring"
|
||||||
cp "$JAR_FILE" "${SPRING_HOME}/spring.jar"
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${SPRING_HOME}"
|
||||||
cd "${SPRING_HOME}"
|
cd "${SPRING_HOME}"
|
||||||
|
rm -rf spring* bin lib
|
||||||
|
unzip -o "$JAR_FILE"
|
||||||
|
mv spring*/* .
|
||||||
|
rm -rf spring*
|
||||||
echo
|
echo
|
||||||
|
|
||||||
rm -rf "${SPRING_HOME}"/spring
|
test -x "${SPRING_HOME}/bin/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"
|
|
||||||
|
|
||||||
echo "spring ${VERSION} has been installed in your home directory (~/.spring)."
|
echo "spring ${VERSION} has been installed in your home directory (~/.spring)."
|
||||||
echo
|
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
|
||||||
echo "Linking ~/.spring/spring to $PREFIX/spring for your convenience."
|
echo "Linking ${SPRING_HOME}/bin/spring to $PREFIX/spring for your convenience."
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
|
|
||||||
To get started:
|
To get started:
|
||||||
@ -54,9 +54,9 @@ And take a look at the README at https://github.com/springsource/spring-boot#rea
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
elif type sudo >/dev/null 2>&1; then
|
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."
|
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"
|
cat <<"EOF"
|
||||||
|
|
||||||
To get started:
|
To get started:
|
||||||
@ -71,8 +71,8 @@ EOF
|
|||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
Couldn't create the symlink. Please either:
|
Couldn't create the symlink. Please either:
|
||||||
(1) Run the following as root:
|
(1) Run the following as root:
|
||||||
cp ~/.spring/spring /usr/bin/spring
|
cp ${SPRING_HOME}/bin/spring /usr/bin/spring
|
||||||
(2) Add ~/.spring to your path, or
|
(2) Add ${SPRING_HOME}/bin to your path, or
|
||||||
(3) Rerun this command to try again.
|
(3) Rerun this command to try again.
|
||||||
|
|
||||||
Then to get started, take a look at 'spring help' or see the README at
|
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
|
(1) Add ~/.spring to your path, or
|
||||||
(2) Run this command as root:
|
(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
|
Then to get started, take a look at 'spring help' or see the README at
|
||||||
https://github.com/springsource/spring-boot#readme.
|
https://github.com/springsource/spring-boot#readme.
|
||||||
|
Loading…
Reference in New Issue
Block a user