Skip to content

Commit

Permalink
dotnet
Browse files Browse the repository at this point in the history
Signed-off-by: lizz <[email protected]>
  • Loading branch information
innerlee committed Feb 26, 2020
1 parent 0e50f6f commit b569d74
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions zzdotnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"

0 comments on commit b569d74

Please sign in to comment.