From 7bb8562dc1f6c79339bb9c52ff335a1e4acfc22e Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 18 Jun 2022 17:10:40 -0500 Subject: [PATCH] Adding functionality to improve the load of external repositories. --- src/ExoRepo/ExoRepo.class.st | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ExoRepo/ExoRepo.class.st b/src/ExoRepo/ExoRepo.class.st index 06109db..9ee2b5e 100644 --- a/src/ExoRepo/ExoRepo.class.st +++ b/src/ExoRepo/ExoRepo.class.st @@ -12,28 +12,32 @@ ExoRepo >> load [ "I load the configuration of this package using a external Gitea repository." "While more Git independient providers are implemented in Monticello, I will use Iceberg to download the repository and load it from a local directory" - | location localRepo repoName | + | localRepo repoName | "Sometimes repoName and packageName are different, following Pharo's conventions. For example the repoName can be MyPackage, while packageName can be My-Package" repoName := self repositoryName. "Local and remote repo definition" - location := FileLocator localDirectory / 'iceberg' / (self provider) / repoName. - location exists ifFalse: [ + self local exists ifFalse: [ (IceRepositoryCreator new - location: location; + location: self local; remote: (IceGitRemote url: self repository asString, '.git'); createRepository) register ]. "Package loading" - localRepo := 'gitlocal://', location fullName. + localRepo := 'gitlocal://', self local fullName. ^ Metacello new repository: localRepo; baseline: repoName; load. ] +{ #category : #accessing } +ExoRepo >> local [ + ^ FileLocator localDirectory / 'iceberg' / (self provider) / self repositoryName +] + { #category : #accessing } ExoRepo >> provider [ self repository ifNil: [ ^ nil ].