mirror of
https://github.com/awatertrevi/macos-configuration.git
synced 2026-09-22 11:44:36 +00:00
semi-final setup
This commit is contained in:
31
install-dotnet10.fish
Executable file
31
install-dotnet10.fish
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user