Skip to content

baselineOf preload is not working while it is in a playground #967

@Ducasse

Description

@Ducasse
preload: loader package: packageSpec
	self halt.
	#( 'Microdown' ) do: [ :name |
		(IceRepository repositoryNamed: name)
			ifNil: [ self inform: 'Project not found: ' , name ]
			ifNotNil: [ :found |
				found
					unload;
					forget ] ].
	Smalltalk globals 
			at: #BaselineOfMicrodown 
			ifPresent: [ :c | c removeFromSystem ]

I do not succeed to stop to this halt. May be there is a exception catching the halt.
When I execute this logic in a playground I can load the note taker without any problem.

Metacello new	
	baseline: 'TheNoteTaker';	
	repository: 'github://hernanmd/the-note-taker/src';	
	load.

in addition the baseline in Microdown is the ugliest ever.

preload: loader package: packageSpec
	"Ignore pre and post loads if already executed"

	" the prelosing GH script cannot work because 
	it will remove the baseline and repository itself :)
	#( 'Microdown' ) do: [ :name |
		(IceRepository repositoryNamed: name)
			ifNil: [ self inform: 'Project not found: ' , name ]
			ifNotNil: [ :found |
				found
					unload;
					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.
			I should rename them in the future to avoid confusion"

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

I do not even understand what it does

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions