summaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/updateParentRef.sh
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2022-01-19 15:31:03 +0000
committerGerrit Code Review <gerrit@onap.org>2022-01-19 15:31:03 +0000
commit956c8d8c3ba66a4b2d585c59759fdbaf9199a77e (patch)
treef14dca0b3999fcdbdcb26837fa71dfecf535cc9b /integration/src/release_scripts/updateParentRef.sh
parent004586ddd68eb414ee5fed9fa24ba56d7226fb21 (diff)
parentb76315a09b466166a6eec6f0b22f58d3e432c7b9 (diff)
Merge "Add release script, fix sed for MacOS"
Diffstat (limited to 'integration/src/release_scripts/updateParentRef.sh')
-rwxr-xr-xintegration/src/release_scripts/updateParentRef.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/integration/src/release_scripts/updateParentRef.sh b/integration/src/release_scripts/updateParentRef.sh
index 1978e33d..0f10cfbb 100755
--- a/integration/src/release_scripts/updateParentRef.sh
+++ b/integration/src/release_scripts/updateParentRef.sh
@@ -24,6 +24,14 @@ set -e
SCRIPT_NAME=`basename $0`
+# Use the bash internal OSTYPE variable to check for MacOS
+if [[ "$OSTYPE" == "darwin"* ]]
+then
+ SED="gsed"
+else
+ SED="sed"
+fi
+
usage()
{
echo ""
@@ -99,9 +107,9 @@ then
exit 1
fi
-pom_lines=`wc -l $pom_file | sed 's/^[ \t]*//' | cut -f1 -d' '`
-parent_start_line=`grep -n '^[\t ]*<parent>[\t*]*$' $pom_file | cut -f1 -d':'`
-parent_end_line=`grep -n '^[\t ]*</parent>[\t*]*$' $pom_file | cut -f1 -d':'`
+pom_lines=`wc -l $pom_file | $SED 's/^[ \t]*//' | cut -f1 -d' '`
+parent_start_line=`grep -n '^[\t ]*<parent>[\t ]*$' $pom_file | cut -f1 -d':'`
+parent_end_line=`grep -n '^[\t ]*</parent>[\t ]*$' $pom_file | cut -f1 -d':'`
pom_head_lines=$((parent_start_line-1))
pom_tail_lines=$((pom_lines-parent_end_line))