#!/usr/bin/env fish # Installs the .NET 10 SDK on macOS using the official dotnet-install script set DOTNET_INSTALL_DIR "$HOME/.dotnet" echo "Downloading dotnet-install script..." curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh chmod +x /tmp/dotnet-install.sh echo "Installing .NET 10 SDK..." /tmp/dotnet-install.sh --channel 10.0 --install-dir "$DOTNET_INSTALL_DIR" if test $status -ne 0 echo "Error: .NET 10 SDK installation failed." rm -f /tmp/dotnet-install.sh exit 1 end rm -f /tmp/dotnet-install.sh # Check if PATH already includes .dotnet if not contains "$DOTNET_INSTALL_DIR" $PATH echo "" echo "Add the following to your fish config to persist the PATH:" echo " fish_add_path $DOTNET_INSTALL_DIR" end echo "" echo "Done! Installed:" "$DOTNET_INSTALL_DIR/dotnet" --version