appdwarf/apps/mkdotnet

38 lines
679 B
Bash
Executable file

#!/bin/sh
# shellcheck source=../appdwarf
SOURCE=1 . "$(which appdwarf)"
TYPE=Runtime
VER=LTS
while [ $# -gt 0 ]; do
case "$1" in
STS | sts )
VER=STS ;;
SDK | Sdk | sdk )
TYPE=Sdk ;;
esac
shift
done
LINK=https://dotnetcli.azureedge.net/dotnet/$TYPE
TYPE=$(echo "$TYPE" | tr "[:upper:]" "[:lower:]")
VER=$(curl $LINK/"$VER"/latest.version)
LINK="$LINK/$VER/dotnet-$TYPE-$VER-linux-x64.tar.gz"
ungz
script="$0"
apprun() {
export DOTNET_ROOT="$APPDIR"
case "$(basename "$ARGV0")" in
dotnetenv )
exec "$@" ;;
* )
exec "$APPDIR/$(basename "$ARGV0")" "$@" ;;
esac
}
appa
script="$(which appdwarf)"
appmk