Skip to content

Commit

Permalink
Improved dotnet setup
Browse files Browse the repository at this point in the history
  • Loading branch information
NonlinearFruit committed Nov 22, 2024
1 parent a38a8ea commit 2539bb1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
16 changes: 11 additions & 5 deletions bashrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ if [ -f ~/.bashrc_private ]; then
source ~/.bashrc_private
fi

# Aliases
if [ -f ~/.bash_aliases ]; then
source ~/.bash_aliases
fi

# SSH
if [ -d ~/.ssh ]; then
eval $(ssh-agent -s) > /dev/null
Expand Down Expand Up @@ -170,3 +165,14 @@ fi
if is wsl ; then
export PATH="$(echo "$PATH" | sed 's#:/mnt/c/Program Files/nodejs/##g')"
fi

# Dotnet
if [ -d "$HOME/.dotnet" ]; then
export PATH="$HOME/.dotnet:$PATH"
export PATH="$HOME/.dotnet/tools:$PATH"
fi

# Aliases
if [ -f ~/.bash_aliases ]; then
source ~/.bash_aliases
fi
17 changes: 5 additions & 12 deletions setups/csharp.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# dotnet (https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu)
if command -v dnf > /dev/null; then
sudo dnf install -y dotnet-sdk-7.0
else
repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt update
sudo apt install -y dotnet-sdk-7.0
fi
. ~/.bashrc
# dotnet <https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install>
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest
rm ./dotnet-install.sh

# Check for out of date nugets and update them (https://github.com/dotnet-outdated/dotnet-outdated)
dotnet tool install --global dotnet-outdated-tool

0 comments on commit 2539bb1

Please sign in to comment.