From 9c893eb55d1b3ac5bc4874857640056eeb0b5dc4 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 15 Aug 2020 15:38:46 -0700 Subject: [PATCH] Adds OS detection into the publish script --- Tools/publish.cmd | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Tools/publish.cmd b/Tools/publish.cmd index 65a5372c2..0c75dc625 100755 --- a/Tools/publish.cmd +++ b/Tools/publish.cmd @@ -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