pharo-project / pharo-launcher

Lets you manage your pharo images and download new ones
https://pharo-project.github.io/pharo-launcher/
MIT License
108 stars 46 forks source link

[fix] fix recreate image with script #537

Closed hogoww closed 2 years ago

hogoww commented 2 years ago

Simple fix with a pair of tests.

hogoww commented 2 years ago

Actually, it needs to add all the configurations in the new file.

hogoww commented 2 years ago

I did not copy the full configuration, that's work for another day. However the script file reference is not carried over to the new image in spite of the fix. @demarey any Idea what am I missing by any chance?

demarey commented 2 years ago

Hi,

Thanks for the PR. The run of the initialization script is triggered by a flag that is stored in the image metadata: shouldRunInitializationScript. When recreating the image, if the metadata file has not been updated, then the script is not run. You should use the setter #shouldRunInitializationScript: on a PhlImage to ensure the metadata is flushed. Metadata file is not deleted when recreating a new image. You should update metadata of the current image before deleting the image.

hogoww commented 2 years ago

Thanks a lot for the insight !

hogoww commented 2 years ago

I think I did what you told me to, yet, the script is not carried over in the new image. Anything I am missing?