Skip to content

Commit 6e346f8

Browse files
authored
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 <gitea-origin-url/> ``` 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 <gitea-origin-url/> ```
1 parent d92909f commit 6e346f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/package/content/nuget.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<div class="ui form">
55
<div class="field">
66
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.registry"}}</label>
7-
<div class="markup"><pre class="code-block"><code>dotnet nuget add source --name Gitea --username your_username --password your_token <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json"></gitea-origin-url></code></pre></div>
7+
<div class="markup"><pre class="code-block"><code>dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json"></gitea-origin-url></code></pre></div>
88
</div>
99
<div class="field">
1010
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.install"}}</label>
11-
<div class="markup"><pre class="code-block"><code>dotnet add package --source Gitea --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}</code></pre></div>
11+
<div class="markup"><pre class="code-block"><code>dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}</code></pre></div>
1212
</div>
1313
<div class="field">
1414
<label>{{.locale.Tr "packages.nuget.documentation" | Safe}}</label>

0 commit comments

Comments
 (0)