Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude repo file when updating my plugin #550

Open
nebestudio opened this issue Dec 13, 2023 · 1 comment
Open

Exclude repo file when updating my plugin #550

nebestudio opened this issue Dec 13, 2023 · 1 comment

Comments

@nebestudio
Copy link

Hello,

is there a way when updating a plugin with the repo content on github to exclude one settings file? It should be not synchronised, neither deleted.

When having this settings file (settings.php) in my plugin and update the plugin, it gets deleted every time, although I have .gitattributes file in my github repo with this content "settings.php export-ignore".

Thanks in advance!

@nebestudio nebestudio changed the title <?php define('REPO_URL', 'https://github.com/nebestudio/model-comparator-ro-dev'); define('REPO_NAME', 'model-comparator-ro-dev'); define('REPO_BRANCH', 'main'); define('REPO_TOKEN', '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'); Exclude repo file when updating my plugin Dec 13, 2023
@YahnisElsts
Copy link
Owner

It's been a while since I've looked at the relevant part of WordPress core, but I think that the WP plugin updater deletes the entire directory of the old version before installing a new version. So you can't preserve a file in the plugin directory even if the update doesn't include a new version of that file. It will get deleted anyway.

If you really have to keep a specific file unchanged, you might have to write a custom plugin update installer. PUC doesn't handle that part, it just hands the update to WordPress core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants