From 0cf9b3089688236ae6a344b725bdda597bf3c51d Mon Sep 17 00:00:00 2001 From: Wonyoung Choi Date: Fri, 31 Jul 2020 12:06:56 +0900 Subject: [PATCH] Fix dotnet-wrapper.sh to pass quoted string to sdk Change-Id: Id9d45e1854c8f8a8e8b576a7fc91144ff28df0e9 --- tools/dotnet-wrapper.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/dotnet-wrapper.sh b/tools/dotnet-wrapper.sh index 0ef3f90..5cf2c4f 100755 --- a/tools/dotnet-wrapper.sh +++ b/tools/dotnet-wrapper.sh @@ -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[@]}" -- 2.7.4