From d889e79eb95b98b90c0c8ab596716ffcd7e5659d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 5 Nov 2024 14:50:19 +0100 Subject: [PATCH] Improve preload to not be executed during the Pharo bootstrap --- .../BaselineOfMicrodown.class.st | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st index bd45b1e5..7270c151 100644 --- a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st +++ b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st @@ -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' }