From 54bd9259de445b58a8d94a1b20b7a9c3468bae8d Mon Sep 17 00:00:00 2001 From: tremor021 Date: Wed, 1 Oct 2025 14:54:08 +0200 Subject: [PATCH] Add setup_dotnet function to tools.func --- misc/tools.func | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/misc/tools.func b/misc/tools.func index db74a7a0..564402a3 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1,5 +1,26 @@ #!/bin/bash +# ------------------------------------------------------------------------------ +# Installs Microsoft .NET +# +# Description: +# - Installs specified .NET version using Microsoft APT repo +# +# Variables: +# NET_VERSION - .NET version to install (default: "8.0") +# ------------------------------------------------------------------------------ + +function setup_dotnet() { + local NET_VERSION="${NET_VERSION:-8.0}" + + msg_info "Setup .NET $NET_VERSION" + curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg + curl -fsSL https://packages.microsoft.com/config/debian/12/prod.list -o /etc/apt/sources.list.d/msprod.list + $STD apt-get update + $STD apt-get install -y dotnet-sdk-$NET_VERSION + msg_ok "Setup .NET ${NET_VERSION}" +} + # ------------------------------------------------------------------------------ # Installs Node.js and optional global modules. #