You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/09/25 16:25:36 UTC

[skywalking-java] branch bug/test-script created (now 6dc7d21)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch bug/test-script
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git.


      at 6dc7d21  Should not determine the `sed` command syntax via OS only

This branch includes the following new commits:

     new 6dc7d21  Should not determine the `sed` command syntax via OS only

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[skywalking-java] 01/01: Should not determine the `sed` command syntax via OS only

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch bug/test-script
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git

commit 6dc7d215637da978b31fae7f85bf83941e7f61f1
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sun Sep 26 00:25:19 2021 +0800

    Should not determine the `sed` command syntax via OS only
---
 test/plugin/run.sh | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/test/plugin/run.sh b/test/plugin/run.sh
index 2aefd55..0b529e8 100755
--- a/test/plugin/run.sh
+++ b/test/plugin/run.sh
@@ -144,18 +144,17 @@ if [[ ! -d ${agent_home} ]]; then
     ${mvnw} --batch-mode -f ${home}/../../pom.xml -Pagent -DskipTests clean package
 fi
 # if it fails last time, relevant information will be deleted
-if [ "$os" == 'Darwin' ]; then
-    sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
-else
-    sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
-fi
+
+# MacOS sed or GNU sed
+sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml \
+|| \
+sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
+
 # add scenario_name into plugin/pom.xml
 echo check code with the checkstyle-plugin
-if [ "$os" == 'Darwin' ]; then
-    sed -i '' '/<\/sourceDirectories>/i\'$'\n''<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>'$'\n' ./pom.xml
-else
-    sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>' ./pom.xml
-fi
+sed -i '' '/<\/sourceDirectories>/i\'$'\n''<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>'$'\n' ./pom.xml \
+|| \
+sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>' ./pom.xml
 
 if [[ "$force_build" == "on" ]]; then
     profile=
@@ -163,11 +162,9 @@ if [[ "$force_build" == "on" ]]; then
     ${mvnw} --batch-mode -f ${home}/pom.xml clean package -DskipTests ${profile}
 fi
 # remove scenario_name into plugin/pom.xml
-if [ "$os" == 'Darwin' ]; then
-    sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
-else
-    sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
-fi
+sed -i '' '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml \
+|| \
+sed -i '/<sourceDirectory>scenarios\/'"$scenario_name"'<\/sourceDirectory>/d' ./pom.xml
 
 workspace="${home}/workspace/${scenario_name}"
 [[ -d ${workspace} ]] && rm -rf $workspace