tattersoftware / codeigniter4-patches

Automated project updates for CodeIgniter 4
MIT License
30 stars 8 forks source link

'app' folder and other files not updated when using stability switch #5

Closed paulbalandan closed 3 years ago

paulbalandan commented 4 years ago

I see this library to be useful in my project and tried it today. Having hiccups on getting the latest updates on other directories, though. I tried to confirm this with both my installer and Composer's native create-project and both failed in updating.

Consider this installation process:

composer create-project codeigniter4/appstarter my-app
composer require --dev tatter/patches
php builds development # get the developer version
composer update
php spark selfupdate

Since we have already used composer update to update the framework, selfupdate will return that nothing to install or update. But, I want to automatically get also the updated files in app in the develop version (Config\Encryption, cli/error_exception.php) and the updated env file. But these weren't updated.

I haven't seen the internals of this library but I think the checking of the files happen when there were installed? Not sure though.

Environment PHP 7.4.8 Win10

MGatner commented 4 years ago

The issue is running composer update first. When you run selfupdate it basically "snapshots" the vendor folder and then handles the Composer update itself, comparing the results afterwards. Running your exact workflow above without that command should give the desired result.

paulbalandan commented 4 years ago

But if I will leave out composer update I cannot run php spark as the path is still on framework

MGatner commented 4 years ago

Ah I understand the issue now. You would need to load the current version manually. This could be done by forcing the latest version (composer require codeigniter4/codeigniter4@v4.0.4), then removing the version limitation and running selfupdate. I don't think there is an easy way to handle this in the module in its current state. Maybe introducing a separate snapshot command? or an additional parameter to compare against? spark selfupdate --compare "v4.0.4"

paulbalandan commented 4 years ago

Ok. I suppose this is a missing feature as of the moment. 🤔 Your temporary fix is sensible enough for me. I'll try that. Looking forward for this lib's development. Thanks.

MGatner commented 4 years ago

Thanks! I will leave this as a reminder to look into the targeted version option. I actually would use that myself, especially in projects when I forget to use selfupdate and have to mess with rolling things back via Composer. :)

MGatner commented 3 years ago

Version 2 accomplishes this, but in a very different way. See the -c <current version> flag for forcing a previous version.