From 584a5629702f30be02daa07348706288913fc4b8 Mon Sep 17 00:00:00 2001 From: Wanderrful Date: Wed, 14 Aug 2019 22:37:41 -0500 Subject: [PATCH 1/2] Support multiple drives when running CLI using Cygwin See gh-17872 --- .../src/main/executablecontent/bin/spring | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring index 87a7e2e9f4..ec1b88d163 100755 --- a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring +++ b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring @@ -18,7 +18,7 @@ case "$(uname)" in esac # For Cygwin, ensure paths are in UNIX format before anything is touched. -if ${cygwin} ; then +if $cygwin ; then [ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --unix "${JAVA_HOME}") fi @@ -99,12 +99,14 @@ if [ ! -d "${SPRING_HOME}" ]; then exit 2 fi -CLASSPATH=.:${SPRING_HOME}/bin -if [ -d "${SPRING_HOME}/ext" ]; then - CLASSPATH=$CLASSPATH:${SPRING_HOME}/ext +[[ $cygwin ]] && SPRINGPATH=$(cygpath "${SPRING_HOME}") || SPRINGPATH=$SPRING_HOME +CLASSPATH=.:${SPRINGPATH}/bin +if [ -d "${SPRINGPATH}/ext" ]; then + CLASSPATH=$CLASSPATH:${SPRINGPATH}/ext fi -for f in "${SPRING_HOME}"/lib/*; do - CLASSPATH=$CLASSPATH:$f +for f in "${SPRINGPATH}"/lib/*; do + [[ $cygwin ]] && LIBFILE=$(cygpath "$f") || LIBFILE=$f + CLASSPATH=$CLASSPATH:$LIBFILE done if $cygwin; then From 308f2db93099cafc21695e4384aad0900e5c89d5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 3 Sep 2019 17:22:08 +0100 Subject: [PATCH 2/2] Polish "Support multiple drives when running CLI using Cygwin" See gh-17872 --- .../spring-boot-cli/src/main/executablecontent/bin/spring | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring index ec1b88d163..023a4c2b94 100755 --- a/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring +++ b/spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring @@ -99,13 +99,13 @@ if [ ! -d "${SPRING_HOME}" ]; then exit 2 fi -[[ $cygwin ]] && SPRINGPATH=$(cygpath "${SPRING_HOME}") || SPRINGPATH=$SPRING_HOME +[[ "${cygwin}" == "true" ]] && SPRINGPATH=$(cygpath "${SPRING_HOME}") || SPRINGPATH=$SPRING_HOME CLASSPATH=.:${SPRINGPATH}/bin if [ -d "${SPRINGPATH}/ext" ]; then CLASSPATH=$CLASSPATH:${SPRINGPATH}/ext fi for f in "${SPRINGPATH}"/lib/*; do - [[ $cygwin ]] && LIBFILE=$(cygpath "$f") || LIBFILE=$f + [[ "${cygwin}" == "true" ]] && LIBFILE=$(cygpath "$f") || LIBFILE=$f CLASSPATH=$CLASSPATH:$LIBFILE done