Microdown icon indicating copy to clipboard operation
Microdown copied to clipboard

baselineOf preload is not working while it is in a playground

Open Ducasse opened this issue 6 months ago • 1 comments

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

Ducasse avatar Aug 20 '25 19:08 Ducasse

the following does not work either.

Metacello new	
	baseline: 'TheNoteTaker';	
	repository: 'github://hernanmd/the-note-taker/src';	
	onConflict: [ :ex | ex useIncoming ];
	onUpgrade: [ :ex | ex useIncoming ];
	onDowngrade: [ :ex | ex useIncoming ];
	load.

Ducasse avatar Aug 22 '25 11:08 Ducasse