Skip to content

Commit b541c15

Browse files
committed
update
1 parent 2c79610 commit b541c15

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cls/GitHub/API.cls

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,16 +531,18 @@ ClassMethod UpdateMirrorReposInDirectory(Directory As %String = {..#Directory})
531531

532532
/// ArchiveFormat - Can be either tarball or zipball. Default: tarball
533533
/// Ref - A valid Git reference. Default: the repository’s default branch (usually master)
534-
Method GetArchive(Owner As %String, Repo As %String, ArchiveFormat As %String = "tarball", Ref As %String = "master", Filename As %String) As %Status
534+
ClassMethod GetArchive(Owner As %String, Repo As %String, ArchiveFormat As %String = "tarball", Ref As %String = "master", Filename As %String, Username As %String = {..#Username}, Password As %String = {..#Password}) As %Status
535535
{
536-
Set ..Request.Location = "/repos/"_Owner_"/"_Repo_"/"_ArchiveFormat_"/"_Ref
536+
Set apiUM = ..%New(Username, Password)
537537

538-
Set st = ..Request.Get()
538+
Set apiUM.Request.Location = "/repos/"_Owner_"/"_Repo_"/"_ArchiveFormat_"/"_Ref
539+
540+
Set st = apiUM.Request.Get()
539541

540542
Set file = ##class(%Stream.FileBinary).%New()
541543
Set file.Filename = Filename
542544

543-
Set st = file.CopyFromAndSave(..Request.HttpResponse.Data)
545+
Set st = file.CopyFromAndSave(apiUM.Request.HttpResponse.Data)
544546

545547
Return st
546548
}

0 commit comments

Comments
 (0)