From 465d73061678210b79072ad3207407fdba1ae64f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 15 Sep 2021 11:55:53 +0100 Subject: [PATCH] Fixes issue with dotnet new template if you did not specify a connection string it was adding an empty one in appsettings.dev --- build/templates/UmbracoProject/.template.config/template.json | 4 ++++ build/templates/UmbracoProject/appsettings.Development.json | 2 ++ 2 files changed, 6 insertions(+) diff --git a/build/templates/UmbracoProject/.template.config/template.json b/build/templates/UmbracoProject/.template.config/template.json index 1512ce597b..3d4f197164 100644 --- a/build/templates/UmbracoProject/.template.config/template.json +++ b/build/templates/UmbracoProject/.template.config/template.json @@ -282,6 +282,10 @@ ] } }, + "HasConnectionString":{ + "type": "computed", + "value": "(ConnectionString != \"\")" + }, "HasNoNodesViewPath":{ "type": "computed", "value": "(NoNodesViewPath != \"\")" diff --git a/build/templates/UmbracoProject/appsettings.Development.json b/build/templates/UmbracoProject/appsettings.Development.json index 59b6882a6b..dad70ac5d8 100644 --- a/build/templates/UmbracoProject/appsettings.Development.json +++ b/build/templates/UmbracoProject/appsettings.Development.json @@ -17,9 +17,11 @@ } ] }, + //#if (HasConnectionString) "ConnectionStrings": { "umbracoDbDSN": "CONNECTION_FROM_TEMPLATE" }, + //#endif "Umbraco": { "CMS": { "Content": {