Fix rtd merge job to handle new tag uploaded
[releng/global-jjb.git] / shell / maven-fetch-metadata.sh
index 270056f..45f1a9b 100644 (file)
@@ -13,9 +13,9 @@ echo "---> maven-fetch-metadata.sh"
 
 # Check for "-f" maven param, indicating a change in pom location.
 pom_path="pom.xml"
-file_path=$(echo $MAVEN_PARAMS | grep -E "\-f \S+" | awk '{ print $2 }')
-if [ ! -z $file_path ]; then
-    if [ -d $file_path ]; then
+file_path=$(echo "$MAVEN_PARAMS" | grep -E "\-f \S+" | awk '{ print $2 }')
+if [ -n "$file_path" ]; then
+    if [ -d "$file_path" ]; then
         pom_path="$file_path/pom.xml"
     else
         pom_path="$file_path"
@@ -31,7 +31,7 @@ project=$(xmlstarlet sel \
       -v "/x:project/x:groupId" \
     --elif "/x:project/x:parent/x:groupId" \
       -v "/x:project/x:parent/x:groupId" \
-    --else -o "" $pom_path)
+    --else -o "" "$pom_path")
 project_path="${project//.//}"
 
 mkdir -p "$WORKSPACE/m2repo/$project_path"