From 31164ea3d1e58db6adc5ad71c7374e75a742e356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCsters?= Date: Thu, 18 Jan 2024 17:36:25 +0100 Subject: [PATCH] Check for package existance before removing it --- src/sdk-auto-generate-dotnet/templates/script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sdk-auto-generate-dotnet/templates/script.sh b/src/sdk-auto-generate-dotnet/templates/script.sh index d967dd3..7b94402 100644 --- a/src/sdk-auto-generate-dotnet/templates/script.sh +++ b/src/sdk-auto-generate-dotnet/templates/script.sh @@ -89,7 +89,9 @@ git checkout $projectPath/$packageName.csproj dotnet add $projectPath/$packageName.csproj package SpaceBlocks.Libs.Sdk # Remove the Newtonsoft.Json dependency because it is already included in SpaceBlocks.Libs.Sdk -dotnet remove $projectPath/$packageName.csproj package Newtonsoft.Json +if grep -q "Newtonsoft.Json" "$projectPath/$packageName.csproj"; then + dotnet remove "$projectPath/$packageName.csproj" package Newtonsoft.Json +fi # Place partial class ApiClient`.cs cat > $projectPath/Client/ApiClient\`.cs <