Fix dotnet-wrapper.sh to pass quoted string to sdk 61/239961/1 accepted/tizen/unified/20200731.145632 submit/tizen/20200731.044753
authorWonyoung Choi <wy80.choi@samsung.com>
Fri, 31 Jul 2020 03:06:56 +0000 (12:06 +0900)
committerWonyoung Choi <wy80.choi@samsung.com>
Fri, 31 Jul 2020 03:23:03 +0000 (12:23 +0900)
Change-Id: Id9d45e1854c8f8a8e8b576a7fc91144ff28df0e9

tools/dotnet-wrapper.sh

index 0ef3f90..5cf2c4f 100755 (executable)
@@ -7,27 +7,27 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
 export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2
 export MSBUILDDISABLENODEREUSE=true
 
-CMD=$1
+CMD=$1; shift
 if [ "$CMD" == "restore" ]; then
   while [[ $# -gt 0 ]]; do
     x="$1"
-    if [ $x == "-s" ] || [ $x == "--source" ]; then
-      ARGS+=" $x $(readlink -m $2)"
+    if [ "$x" == "-s" -o "$x" == "--source" ]; then
+      ARGS+=($x $(readlink -m $2))
       shift
-    elif [[ $x =~ --source=(.+) ]]; then
-      ARGS+=" --source=$(readlink -m ${BASH_REMATCH[1]})"
+    elif [[ "$x" =~ --source=(.+) ]]; then
+      ARGS+=(--source=$(readlink -m $(eval echo ${BASH_REMATCH[1]})))
     else
-      ARGS+=" $x"
+      ARGS+=("$x")
     fi
     shift
   done
 else
-  ARGS="$@"
+  ARGS=("$@")
 fi
 
 if [ "$CMD" == "msbuild" -o "$CMD" == "build" -o  "$CMD" == "restore" ] ; then
-  ARGS+=" /nodeReuse:false /p:UseSharedCompilation=false"
+  ARGS+=(/nodeReuse:false /p:UseSharedCompilation=false)
 fi
 
-echo $DOTNET_CLI_PATH $ARGS
-$DOTNET_CLI_PATH $ARGS
+echo $DOTNET_CLI_PATH $CMD "${ARGS[@]}"
+$DOTNET_CLI_PATH $CMD "${ARGS[@]}"