I would recommend using a migration to do this, since this is an upgrade you can check in the Up() method of the migration what files are still there and delete them accordingly.
It's not fool-proof though, as we know: people will be running this and seeing in git: hey, some files have been deleted, I better revert them, they could be important.
By far the biggest benefit of doing this using a migration is that the cleanup will run on every environment it is deploy to, so if someone updates on their local machine and pushes changes to live, the migration will run again.
This post deals with database changes, but you can run any C# code you want. Be careful though, make sure you don't cause any YSODs doing this, people will get upset.. ;-)
How to remove unused package files?
Hi all,
when you release a new version of your package and you have removed some files.
How can we do the same when someone upgrades to this new version using the Packages tree in the Developer section?
Can we use Package Actions to perform this task?
Its about .html files that we want to delete from the package.
/Michaël
I would recommend using a migration to do this, since this is an upgrade you can check in the
Up()
method of the migration what files are still there and delete them accordingly.It's not fool-proof though, as we know: people will be running this and seeing in git: hey, some files have been deleted, I better revert them, they could be important.
By far the biggest benefit of doing this using a migration is that the cleanup will run on every environment it is deploy to, so if someone updates on their local machine and pushes changes to live, the migration will run again.
Read more about migrations here: https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
This post deals with database changes, but you can run any C# code you want. Be careful though, make sure you don't cause any YSODs doing this, people will get upset.. ;-)
Then maybe it will be the best to just let the unused files stay in the folder.
/Michaël
is working on a reply...