Skip to content
Snippets Groups Projects
Commit b38034e8 authored by David Y. Ross's avatar David Y. Ross Committed by Patrick Wendell
Browse files

Fix command spaces issue in make-distribution.sh

Storing command in variables is tricky in bash, use an array
to handle all issues with spaces, quoting, etc.
See: http://mywiki.wooledge.org/BashFAQ/050

Author: David Y. Ross <dyross@gmail.com>

Closes #4126 from dyross/dyr-fix-make-distribution and squashes the following commits:

4ce522b [David Y. Ross] Fix command spaces issue in make-distribution.sh
parent 54e7b456
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ if which git &>/dev/null; then
unset GITREV
fi
if ! which $MVN &>/dev/null; then
if ! which "$MVN" &>/dev/null; then
echo -e "Could not locate Maven command: '$MVN'."
echo -e "Specify the Maven command with the --mvn flag"
exit -1;
......@@ -171,13 +171,16 @@ cd "$SPARK_HOME"
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
BUILD_COMMAND="$MVN clean package -DskipTests $@"
# Store the command as an array because $MVN variable might have spaces in it.
# Normal quoting tricks don't work.
# See: http://mywiki.wooledge.org/BashFAQ/050
BUILD_COMMAND=("$MVN" clean package -DskipTests $@)
# Actually build the jar
echo -e "\nBuilding with..."
echo -e "\$ $BUILD_COMMAND\n"
echo -e "\$ ${BUILD_COMMAND[@]}\n"
${BUILD_COMMAND}
"${BUILD_COMMAND[@]}"
# Make directories
rm -rf "$DISTDIR"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment