forked from innerlee/setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zzdotnet.sh
29 lines (24 loc) · 828 Bytes
/
zzdotnet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# install dotnet
set -e
ROOTDIR=${ZZROOT:-$HOME/app}
NAME="dotnet"
TYPE=".tar.gz"
FILE="$NAME$TYPE"
DOWNLOADURL="https://dotnetcli.azureedge.net/dotnet/Sdk/3.1.102/dotnet-sdk-3.1.102-linux-x64.tar.gz"
echo $NAME will be installed in "$ROOTDIR"
mkdir -p "$ROOTDIR/downloads"
cd "$ROOTDIR"
if [ -f "downloads/$FILE" ]; then
echo "downloads/$FILE exist"
else
echo "$FILE does not exist, downloading from $DOWNLOADURL"
wget $DOWNLOADURL -O $FILE
mv $FILE downloads/
fi
tar zxf downloads/$FILE -C $ROOTDIR/dotnet
echo $NAME installed on "$ROOTDIR", put the following lines into .zshrc or .bashrc
echo "export DOTNET_ROOT=$ROOTDIR/dotnet"
echo "export PATH=\$PATH:$ROOTDIR/dotnet"
echo "export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true"
echo "export MSBuildSDKsPath=$ROOTDIR/dotnet/sdk/3.1.102/Sdks"