File tree Expand file tree Collapse file tree 3 files changed +17
-13
lines changed
routers/api/packages/conda Expand file tree Collapse file tree 3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ func EnumeratePackages(ctx *context.Context) {
148148 Timestamp : fileMetadata .Timestamp ,
149149 Build : fileMetadata .Build ,
150150 BuildNumber : fileMetadata .BuildNumber ,
151- Dependencies : fileMetadata .Dependencies ,
151+ Dependencies : util . SliceNilAsEmpty ( fileMetadata .Dependencies ) ,
152152 License : versionMetadata .License ,
153153 LicenseFamily : versionMetadata .LicenseFamily ,
154154 HashMD5 : pfd .Blob .HashMD5 ,
Original file line number Diff line number Diff line change 7878 {{ctx.Locale.Tr "repo.release.downloads"}}
7979 </summary>
8080 <ul class="ui divided list attachment-list">
81- {{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
82- <li class="item">
83- <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
84- <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
85- </a>
86- </li>
87- <li class="item">
88- <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
89- <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
90- </a>
91- </li>
92- {{end}}
9381 {{range $att := $release.Attachments}}
9482 <li class="item">
9583 <a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
10593 </div>
10694 </li>
10795 {{end}}
96+ {{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
97+ <li class="item">
98+ <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
99+ <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
100+ </a>
101+ </li>
102+ <li class="item">
103+ <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
104+ <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
105+ </a>
106+ </li>
107+ {{end}}
108108 </ul>
109109 </details>
110110 </div>
Original file line number Diff line number Diff line change @@ -237,6 +237,8 @@ func TestPackageConda(t *testing.T) {
237237 assert .Equal (t , pd .Files [0 ].Blob .HashMD5 , packageInfo .HashMD5 )
238238 assert .Equal (t , pd .Files [0 ].Blob .HashSHA256 , packageInfo .HashSHA256 )
239239 assert .Equal (t , pd .Files [0 ].Blob .Size , packageInfo .Size )
240+ assert .NotNil (t , packageInfo .Dependencies )
241+ assert .Empty (t , packageInfo .Dependencies )
240242 })
241243
242244 t .Run (".conda" , func (t * testing.T ) {
@@ -268,6 +270,8 @@ func TestPackageConda(t *testing.T) {
268270 assert .Equal (t , pd .Files [0 ].Blob .HashMD5 , packageInfo .HashMD5 )
269271 assert .Equal (t , pd .Files [0 ].Blob .HashSHA256 , packageInfo .HashSHA256 )
270272 assert .Equal (t , pd .Files [0 ].Blob .Size , packageInfo .Size )
273+ assert .NotNil (t , packageInfo .Dependencies )
274+ assert .Empty (t , packageInfo .Dependencies )
271275 })
272276 })
273277}
You can’t perform that action at this time.
0 commit comments