Skip to content

Commit

Permalink
Merge pull request #918 from jecisc/misc/specialize-preload
Browse files Browse the repository at this point in the history
Improve preload to not be executed during the Pharo bootstrap
  • Loading branch information
jecisc authored Nov 5, 2024
2 parents f22ed0d + d889e79 commit fb663e2
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,18 @@ BaselineOfMicrodown >> preload: loader package: packageSpec [
forget ] ]"

| packagesToUnload |
"If we are building the Pharo image, we do not want to unload packages."
SystemBuildInfo current isBuildFinished ifFalse: [ ^ self ].

"If it is absent it's because we are in the Pharo bootstrap"
self class environment
at: #IceRepository
ifPresent: [ :iceRepositoryClass |

packagesToUnload := ((PackageOrganizer default packages select: [
:each | each name beginsWith: 'Microdown' ])
collect: [ :each | each name ]) reject: [
:each |
#( 'Microdown-RichTextPresenter'
'Microdown-RichTextPresenter-Tests' )
includes: each ].

"these two are not managed by the microdown repo but the documentation.
self class environment at: #IceRepository ifPresent: [ :iceRepositoryClass |
packagesToUnload := ((PackageOrganizer default packages select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) reject: [ :each |
#( 'Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests' ) includes: each ].

"these two are not managed by the microdown repo but the documentation.
I should rename them in the future to avoid confusion"

packagesToUnload do: [ :each |
((iceRepositoryClass repositoryNamed: 'Microdown') packageNamed:
each) unload ] ]
packagesToUnload do: [ :each | ((iceRepositoryClass repositoryNamed: 'Microdown') packageNamed: each) unload ] ]
]

{ #category : 'external projects' }
Expand Down

0 comments on commit fb663e2

Please sign in to comment.