@@ -286,16 +286,30 @@ ClassMethod GetModuleMeta(url As %String) As %DynamicObject
286
286
Set ht .Port = port
287
287
}
288
288
Set ht .Location = tComponents (" path" )_" master/module.xml"
289
-
290
289
$$$ThrowOnError(ht .Get ())
291
290
If (ht .HttpResponse .StatusCode '=200 ) {
292
291
$$$ThrowStatus($$$ERROR(5001 ," Unable to download XML " _ht .Location ))
293
292
}
294
- $$$ThrowOnError(##class (%XML.XPATH.Document ).CreateFromStream (ht .HttpResponse .Data , .xpathdoc ))
293
+ Set tmpFolder = $$$FileTempDir
294
+ Do ##class (%File ).CreateDirectory (tmpFolder )
295
+
296
+ Set stream =##class (%Stream.FileCharacter ).%New ()
297
+ Do stream .LinkToFile (tmpFolder _" /module.xml" )
298
+ Set stream .TranslateTable = " UTF8"
299
+ Do stream .CopyFrom (ht .HttpResponse .Data )
300
+ Do stream .%Save ()
301
+
302
+ set binaryStream =##class (%Stream.FileBinary ).%New ()
303
+ do binaryStream .LinkToFile (tmpFolder _" /module.xml" )
304
+
305
+ $$$ThrowOnError(##class (%XML.XPATH.Document ).CreateFromStream (binaryStream , .xpathdoc ))
295
306
$$$ThrowOnError(xpathdoc .EvaluateExpression (" /" ," Export/Document/Module/Version/text()" , .tResults ))
296
307
set jo .version = tResults .GetAt (1 ).ValueGet ()
297
308
$$$ThrowOnError(xpathdoc .EvaluateExpression (" /" ," Export/Document/Module/Name/text()" , .tResults ))
298
309
set jo .name = tResults .GetAt (1 ).ValueGet ()
310
+
311
+ Do ##class (%File ).RemoveDirectoryTree (tmpFolder )
312
+
299
313
return jo
300
314
}
301
315
@@ -339,7 +353,6 @@ ClassMethod UpdatePackage(jo As %DynamicObject) As %Status
339
353
340
354
ClassMethod Publish (url As %String , name As %String ) As %Status
341
355
{
342
-
343
356
Set outputFolder = ..DownloadPackageFromGitHub (url )
344
357
Set packageFolder = ##class (%File ).NormalizeDirectory (name _ " -master" , outputFolder )
345
358
Return ..LoadPackage (packageFolder , url , 1 )
0 commit comments