summaryrefslogtreecommitdiffstats
path: root/templates/package/content
diff options
context:
space:
mode:
authorBob Vandevliet <info@bvandevliet.nl>2023-04-06 23:35:32 +0200
committerGitHub <noreply@github.com>2023-04-06 17:35:32 -0400
commit6e346f84c1cd015edec9b491c05017cf29fe7c1e (patch)
tree682cadb5d58b2e9556792660c5d0b7a02fbdf2c1 /templates/package/content
parentd92909fa8b4427cb3e6fca4ec18487ab506e34bf (diff)
downloadgitea-6e346f84c1cd015edec9b491c05017cf29fe7c1e.tar.gz
gitea-6e346f84c1cd015edec9b491c05017cf29fe7c1e.zip
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/> ```
Diffstat (limited to 'templates/package/content')
-rw-r--r--templates/package/content/nuget.tmpl4
1 files 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 @@
<div class="ui form">
<div class="field">
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.registry"}}</label>
- <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>
+ <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>
</div>
<div class="field">
<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.install"}}</label>
- <div class="markup"><pre class="code-block"><code>dotnet add package --source Gitea --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}</code></pre></div>
+ <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>
</div>
<div class="field">
<label>{{.locale.Tr "packages.nuget.documentation" | Safe}}</label>