Skip to content

Commit 20a520a

Browse files
committed
Use awk command according to the comments.
1 parent 9c4add2 commit 20a520a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

build/mvn

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ install_app() {
7070
# Determine the Maven version from the root pom.xml file and
7171
# install maven under the build/ folder if needed.
7272
install_mvn() {
73-
local MVN_VERSION=`grep "<maven.version>" "${_DIR}/../pom.xml" | \
74-
head -1 | cut -f2 -d'>' | cut -f1 -d'<'`
73+
local MVN_VERSION=`grep "<maven.version>" "${_DIR}/../pom.xml" | head -n1 | awk -F '[<>]' '{print $3}'`
7574
MVN_BIN="$(command -v mvn)"
7675
if [ "$MVN_BIN" ]; then
7776
local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print $3}')"
@@ -108,8 +107,7 @@ install_zinc() {
108107
# the build/ folder
109108
install_scala() {
110109
# determine the Scala version used in Spark
111-
local scala_version=`grep "scala.version" "${_DIR}/../pom.xml" | \
112-
head -1 | cut -f2 -d'>' | cut -f1 -d'<'`
110+
local scala_version=`grep "scala.version" "${_DIR}/../pom.xml" | head -n1 | awk -F '[<>]' '{print $3}'`
113111
local scala_bin="${_DIR}/scala-${scala_version}/bin/scala"
114112
local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.typesafe.com}
115113

0 commit comments

Comments
 (0)