#!/bin/bash set -x SYSTEM=`uname -s` BUILD_CONFIG=Debug PUBLISH_CONFIG=Release NETCOREVER=netcoreapp3.1 RUNTIME_MAC=osx.10.12-x64 RUNTIME=$RUNTIME_MAC if [ $SYSTEM = "Darwin" ] ; then echo "****************************** begin build **********************" else echo "*****************build error only use in mac build computer******" exit 0 fi RESTORE=true build_one_proj_exe() { if [ $RESTORE = "true" ] ; then dotnet restore ./$1 fi str=$RUNTIME"/bin" dotnet build $1 --configuration $BUILD_CONFIG --runtime $RUNTIME --output $str --framework $NETCOREVER if [ $? -ne 0 ]; then echo "****************************** build error ******************************" exit 0 fi } build_one_proj_exe ExcelExport echo $SYSTEM