diff --git a/src/ExoRepo/MCGiteabRepository.class.st b/src/ExoRepo/MCGiteabRepository.class.st index df9d2a8..96806df 100644 --- a/src/ExoRepo/MCGiteabRepository.class.st +++ b/src/ExoRepo/MCGiteabRepository.class.st @@ -18,3 +18,29 @@ MCGiteabRepository class >> basicFromUrl: aZnUrl [ MCGiteabRepository class >> urlSchemes [ ^ #(gitea) ] + +{ #category : #accessing } +MCGiteabRepository >> branches [ + "IMPORTANT! This requires the installation of the external multiplatform binary dependency + restify at: https://github.com/itzg/restify/. + + This should be installed independiently." + | response | + response := OrderedDictionary new. + OSSUnixSubprocess new + shellCommand: 'restify --class="gt-ellipsis" ', 'https://', self projectPath, '/branches'; + redirectStdout; + runAndWaitOnExitDo: [ :command :outString | + (STON fromString: outString) do: [:each | + response at: (each at: 'text') put: (each at: 'href') + ] + ]. + ^ response +] + +{ #category : #accessing } +MCGiteabRepository >> projectVersion [ + (projectVersion == nil or: [ projectVersion isEmpty ]) + ifTrue: [ projectVersion := self branches keys first ]. + ^ projectVersion +]