Adds OS detection into the publish script

This commit is contained in:
Kamron Batman 2020-08-15 15:38:46 -07:00
parent bc2487946c
commit 9c893eb55d
No known key found for this signature in database
GPG key ID: 5C9DFD15804B6BB8

View file

@ -6,6 +6,15 @@ dotnet restore --force-evaluate
GOTO :CMDSCRIPT
::SHELLSCRIPT
if [[ $(uname) = "Darwin" ]]
then
r="-r osx-x64"
if [[ -f /etc/os-release ]]
then
. /etc/os-release
r="-r ${NAME,,}.$VERSION_ID-x64"
fi
if [[ -z $2 ]] || [[ ${2,,} = "core" ]]
then
f="-f netcoreapp3.1"
@ -20,19 +29,6 @@ else
c="-c ${3^}"
fi
if [[ $1 ]]
then
runtime=${1,,}
r="-r $runtime-x64"
else
if [[ $(uname) = "Darwin" ]]
then
r="-r osx-x64"
else
r="-r linux-x64"
fi
fi
echo dotnet publish ${c} ${r} ${f} --no-restore --self-contained=false -o Distribution Projects/Server/Server.csproj
dotnet publish ${c} ${r} ${f} --no-restore --self-contained=false -o Distribution Projects/Server/Server.csproj
echo dotnet publish ${c} ${r} ${f} --no-restore --self-contained=false -o Distribution/Assemblies Projects/UOContent/UOContent.csproj