use flake DOTNET_PATH=$(readlink "$(which dotnet)") SETTINGS_FILE=$(find . -maxdepth 1 -type f -name '*.sln.DotSettings.user') MSBUILD=$(realpath "$(find "$(dirname "$DOTNET_PATH")/../share/dotnet/sdk" -maxdepth 2 -type f -name MSBuild.dll)") if [ -f "$SETTINGS_FILE" ] ; then xmlstarlet ed --inplace \ -N wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \ -N x="http://schemas.microsoft.com/winfx/2006/xaml" \ -N s="clr-namespace:System;assembly=mscorlib" \ -N ss="urn:shemas-jetbrains-com:settings-storage-xaml" \ --update "//s:String[@x:Key='/Default/Environment/Hierarchy/Build/BuildTool/DotNetCliExePath/@EntryValue']" \ --value "$(realpath "$(dirname "$DOTNET_PATH")/../share/dotnet/dotnet")" \ "$SETTINGS_FILE" xmlstarlet ed --inplace \ -N wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \ -N x="http://schemas.microsoft.com/winfx/2006/xaml" \ -N s="clr-namespace:System;assembly=mscorlib" \ -N ss="urn:shemas-jetbrains-com:settings-storage-xaml" \ --update "//s:String[@x:Key='/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue']" \ --value "$MSBUILD" \ "$SETTINGS_FILE" fi