Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
fcc73c6d
Commit
fcc73c6d
authored
Oct 02, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Fix shellcheck warnings in CLI's bash script"
Closes gh-11458
parent
69b844cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
27 deletions
+28
-27
spring
...ect/spring-boot-cli/src/main/executablecontent/bin/spring
+28
-27
No files found.
spring-boot-project/spring-boot-cli/src/main/executablecontent/bin/spring
View file @
fcc73c6d
...
@@ -29,21 +29,21 @@ if [ -z "${JAVA_HOME}" ]; then
...
@@ -29,21 +29,21 @@ if [ -z "${JAVA_HOME}" ]; then
JAVA_HOME
=
$(
/usr/libexec/java_home
)
JAVA_HOME
=
$(
/usr/libexec/java_home
)
export
JAVA_HOME
export
JAVA_HOME
fi
fi
if
[[
-z
"
${
JAVA_HOME
}
"
&&
-d
"/Library/Java/Home"
]]
;
then
if
[[
-z
"
${
JAVA_HOME
}
"
&&
-d
"/Library/Java/Home"
]]
;
then
export
JAVA_HOME
=
"/Library/Java/Home"
export
JAVA_HOME
=
"/Library/Java/Home"
fi
fi
if
[[
-z
"
${
JAVA_HOME
}
"
&&
-d
"/System/Library/Frameworks/JavaVM.framework/Home"
]]
;
then
if
[[
-z
"
${
JAVA_HOME
}
"
&&
-d
"/System/Library/Frameworks/JavaVM.framework/Home"
]]
;
then
export
JAVA_HOME
=
"/System/Library/Frameworks/JavaVM.framework/Home"
export
JAVA_HOME
=
"/System/Library/Frameworks/JavaVM.framework/Home"
fi
fi
else
else
javaExecutable
=
"
$(
which
javac
)
"
javaExecutable
=
"
$(
command
-v
javac
)
"
if
[[
-z
"
$javaExecutable
"
||
"
$(
expr
"
${
javaExecutable
}
"
:
'\([^ ]*\)'
)
"
=
"no"
]]
;
then
if
[[
-z
"
$javaExecutable
"
||
"
$(
expr
"
${
javaExecutable
}
"
:
'\([^ ]*\)'
)
"
=
"no"
]]
;
then
echo
"JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
echo
"JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
exit
1
exit
1
fi
fi
# readlink(1) is not available as standard on Solaris 10.
# readlink(1) is not available as standard on Solaris 10.
readLink
=
(
which
readlink
)
readLink
=
"
$(
command
-v
readlink
)
"
[
$(
expr
"
$readLink
"
:
'\([^ ]*\)'
)
=
"no"
]
&&
{
[
"
$(
expr
"
${
readLink
}
"
:
'\([^ ]*\)'
)
"
=
"no"
]
&&
{
echo
"JAVA_HOME not set and readlink not available, please set JAVA_HOME."
echo
"JAVA_HOME not set and readlink not available, please set JAVA_HOME."
exit
1
exit
1
}
}
...
@@ -58,39 +58,39 @@ fi
...
@@ -58,39 +58,39 @@ fi
# Sanity check that we have java
# Sanity check that we have java
if
[
!
-f
"
${
JAVA_HOME
}
/bin/java"
]
;
then
if
[
!
-f
"
${
JAVA_HOME
}
/bin/java"
]
;
then
cat
<<-
JAVA_HOME_NOT_SET_TXT
cat
<<-
JAVA_HOME_NOT_SET_TXT
======================================================================================================
======================================================================================================
Please ensure that your JAVA_HOME points to a valid Java SDK.
Please ensure that your JAVA_HOME points to a valid Java SDK.
You are currently pointing to:
You are currently pointing to:
${
JAVA_HOME
}
${
JAVA_HOME
}
This does not seem to be valid. Please rectify and restart.
This does not seem to be valid. Please rectify and restart.
======================================================================================================
======================================================================================================
JAVA_HOME_NOT_SET_TXT
JAVA_HOME_NOT_SET_TXT
exit
1
exit
1
fi
fi
# Attempt to find SPRING_HOME if not already set
# Attempt to find SPRING_HOME if not already set
if
[
-z
"
${
SPRING_HOME
}
"
]
;
then
if
[
-z
"
${
SPRING_HOME
}
"
]
;
then
# Resolve links: $0 may be a link
# Resolve links: $0 may be a link
PRG
=
"
$0
"
PRG
=
"
$0
"
# Need this for relative symlinks.
# Need this for relative symlinks.
while
[
-h
"
$PRG
"
]
;
do
while
[
-h
"
$PRG
"
]
;
do
ls
=
$(
ls
-ld
"
$PRG
"
)
ls
=
$(
ls
-ld
"
$PRG
"
)
link
=
$(
expr
"
$ls
"
:
'.*-> \(.*\)$'
)
link
=
$(
expr
"
$ls
"
:
'.*-> \(.*\)$'
)
if
expr
"
$link
"
:
'/.*'
>
/dev/null
;
then
if
expr
"
$link
"
:
'/.*'
>
/dev/null
;
then
PRG
=
"
$link
"
PRG
=
"
$link
"
else
else
PRG
=
$(
dirname
"
$PRG
"
)
"/
$link
"
PRG
=
$(
dirname
"
$PRG
"
)
"/
$link
"
fi
fi
done
done
SAVED
=
"
$(
pwd
)
"
SAVED
=
"
$(
pwd
)
"
cd
"
$(
dirname
"
${
PRG
}
"
)
/../"
>
&-
cd
"
$(
dirname
"
${
PRG
}
"
)
/../"
>
&-
||
exit
1
SPRING_HOME
=
"
$(
pwd
-P
)
"
SPRING_HOME
=
"
$(
pwd
-P
)
"
export
SPRING_HOME
export
SPRING_HOME
cd
"
$SAVED
"
>
&-
cd
"
$SAVED
"
>
&-
||
exit
1
fi
fi
if
[
!
-d
"
${
SPRING_HOME
}
"
]
;
then
if
[
!
-d
"
${
SPRING_HOME
}
"
]
;
then
...
@@ -103,7 +103,7 @@ CLASSPATH=.:${SPRING_HOME}/bin
...
@@ -103,7 +103,7 @@ CLASSPATH=.:${SPRING_HOME}/bin
if
[
-d
"
${
SPRING_HOME
}
/ext"
]
;
then
if
[
-d
"
${
SPRING_HOME
}
/ext"
]
;
then
CLASSPATH
=
$CLASSPATH
:
${
SPRING_HOME
}
/ext
CLASSPATH
=
$CLASSPATH
:
${
SPRING_HOME
}
/ext
fi
fi
for
f
in
${
SPRING_HOME
}
/lib/
*
;
do
for
f
in
"
${
SPRING_HOME
}
"
/lib/
*
;
do
CLASSPATH
=
$CLASSPATH
:
$f
CLASSPATH
=
$CLASSPATH
:
$f
done
done
...
@@ -112,4 +112,5 @@ if $cygwin; then
...
@@ -112,4 +112,5 @@ if $cygwin; then
CLASSPATH
=
$(
cygpath
--path
--mixed
"
$CLASSPATH
"
)
CLASSPATH
=
$(
cygpath
--path
--mixed
"
$CLASSPATH
"
)
fi
fi
"
${
JAVA_HOME
}
/bin/java"
${
JAVA_OPTS
}
-cp
"
$CLASSPATH
"
org.springframework.boot.loader.JarLauncher
"
$@
"
IFS
=
" "
read
-r
-a
javaOpts
<<<
"
$JAVA_OPTS
"
"
${
JAVA_HOME
}
/bin/java"
"
${
javaOpts
[@]
}
"
-cp
"
$CLASSPATH
"
org.springframework.boot.loader.JarLauncher
"
$@
"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment