Adding functionality to improve the load of external repositories.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-06-18 17:10:40 -05:00
parent 4192c2cd2e
commit 7bb8562dc1
1 changed files with 9 additions and 5 deletions

View File

@ -12,28 +12,32 @@ ExoRepo >> load [
"I load the configuration of this package using a external Gitea repository." "I load the configuration of this package using a external Gitea repository."
"While more Git independient providers are implemented in Monticello, I will "While more Git independient providers are implemented in Monticello, I will
use Iceberg to download the repository and load it from a local directory" 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. "Sometimes repoName and packageName are different, following Pharo's conventions.
For example the repoName can be MyPackage, while packageName can be My-Package" For example the repoName can be MyPackage, while packageName can be My-Package"
repoName := self repositoryName. repoName := self repositoryName.
"Local and remote repo definition" "Local and remote repo definition"
location := FileLocator localDirectory / 'iceberg' / (self provider) / repoName. self local exists ifFalse: [
location exists ifFalse: [
(IceRepositoryCreator new (IceRepositoryCreator new
location: location; location: self local;
remote: (IceGitRemote url: self repository asString, '.git'); remote: (IceGitRemote url: self repository asString, '.git');
createRepository) createRepository)
register register
]. ].
"Package loading" "Package loading"
localRepo := 'gitlocal://', location fullName. localRepo := 'gitlocal://', self local fullName.
^ Metacello new ^ Metacello new
repository: localRepo; repository: localRepo;
baseline: repoName; baseline: repoName;
load. load.
] ]
{ #category : #accessing }
ExoRepo >> local [
^ FileLocator localDirectory / 'iceberg' / (self provider) / self repositoryName
]
{ #category : #accessing } { #category : #accessing }
ExoRepo >> provider [ ExoRepo >> provider [
self repository ifNil: [ ^ nil ]. self repository ifNil: [ ^ nil ].