From 6e346f84c1cd015edec9b491c05017cf29fe7c1e Mon Sep 17 00:00:00 2001 From: Bob Vandevliet Date: Thu, 6 Apr 2023 23:35:32 +0200 Subject: [PATCH] More specific and unique feed name for NuGet install command template. (#23889) The default command to setup a NuGet registry from the command line is: ``` dotnet nuget add source --name Gitea --username your_username --password your_token ``` The feed name `Gitea` is hard-coded into the command template, so each registry will by default have the same feed name. I know templates can be overridden using the `custom` folder. But in my opinion, it's a good practice to make a slight change in the default template to make the feed name more context specific: ``` dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token ``` --- templates/package/content/nuget.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index 8ed2f04e4a..d3cf9b09de 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -4,11 +4,11 @@
-
dotnet nuget add source --name Gitea --username your_username --password your_token 
+
dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token 
-
dotnet add package --source Gitea --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}
+
dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}