Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Feb 13, 2018 @ 17:09
    Michaël Vanbrabandt
    0

    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

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Feb 14, 2018 @ 09:03
    Sebastiaan Janssen
    100

    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.. ;-)

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Feb 15, 2018 @ 11:42
    Michaël Vanbrabandt
    0

    Then maybe it will be the best to just let the unused files stay in the folder.

    /Michaël

Please Sign in or register to post replies

Write your reply to:

Draft