# This is a workaround for the relative path issue in dotnet-cli.
# https://github.com/NuGet/Home/issues/9406
CMD=$1; shift
-ARGS=("$@")
+if [ "$CMD" == "restore" ]; then
+ while [[ $# -gt 0 ]]; do
+ x="$1"
+ if [ "$x" == "-s" -o "$x" == "--source" ]; then
+ ARGS+=($x $(readlink -m $2))
+ shift
+ elif [[ "$x" =~ --source=(.+) ]]; then
+ ARGS+=(--source=$(readlink -m $(eval echo ${BASH_REMATCH[1]})))
+ else
+ ARGS+=("$x")
+ fi
+ shift
+ done
+else
+ ARGS=("$@")
+fi
if [ "$CMD" == "msbuild" -o "$CMD" == "build" -o "$CMD" == "restore" ] ; then
# Clear nuget cache for each project build.
if [ ! -f ".nuget_cache_cleared" ]; then
- $DOTNET_CLI_PATH nuget locals all --clear
+ rm -rf $HOME/.nuget/packages/*
touch .nuget_cache_cleared 2>/dev/null || true
fi
fi