Skip to content

Commit 71e3565

Browse files
committed
Fix build.sh for paths containing spaces (e.g. Windows Bash)
1 parent 2293768 commit 71e3565

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

build.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Fresh port from Mukul Gandhi's revised build.bat.
2222
# WARNING: This currently does not include the hooks needed
2323
# to make the script compatable with cygwin (unix/Linux shell
24-
# and commands ported to run under Windows). See
24+
# and commands ported to run under Windows). See
2525
# deprecated_build.sh to see how we handled the cygwin
2626
# syntax differences back in 2001. These days, Windows users
2727
# are more likely to use WSL, which simplifies matters.
@@ -39,7 +39,7 @@ echo
3939
echo Xalan-J test automation build
4040
echo -----------------------------
4141

42-
if [ "$1" = "-h" ]; then
42+
if [ "$1" = "-h" ]; then
4343
echo build.sh - executes Xalan Java-based test automation
4444
echo Usage: build [target] [-D options]
4545
echo Example: build api -DtestClass=TransformerAPITest -Dqetest.loggingLevel=30
@@ -50,19 +50,19 @@ if [ "$1" = "-h" ]; then
5050
exit 1
5151
fi
5252

53-
if [ "$JAVA_HOME" = "" ]; then
53+
if [ "$JAVA_HOME" = "" ]; then
5454
echo Warning: JAVA_HOME environment variable is not exported
5555
echo You may have meant to set it to /etc/alternatives/java_sdk
5656
exit 1
5757
fi
5858

5959
JAVACMD=$JAVA_HOME/bin/java
60-
60+
6161
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
6262

6363
# Default is to use a copy of ant bundled with xalan-java
64-
if [ $ANT_HOME = "" ]; then
65-
_ANT_HOME=../xalan-java
64+
if [ "$ANT_HOME" = "" ]; then
65+
_ANT_HOME=../xalan-java
6666
else
6767
_ANT_HOME=$ANT_HOME
6868
fi
@@ -89,7 +89,7 @@ XALAN_BUILD_DIR_PATH=../xalan-java/build:../build
8989
XERCES_ENDORSED_DIR_PATH=../xalan-java/lib/endorsed:../lib/endorsed
9090

9191
# Reminder: Note $* versus $@ distinction
92-
echo Running: $JAVACMD -mx1024m -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@"
93-
$JAVACMD -mx1024m -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@"
92+
echo Running: "$JAVACMD" -mx1024m -Djava.endorsed.dirs="$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH" -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@"
93+
"$JAVACMD" -mx1024m -Djava.endorsed.dirs="$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH" -classpath "$CLASSPATH" org.apache.tools.ant.Main "$@"
9494

9595
echo "build.sh complete!"

0 commit comments

Comments
 (0)