lra / mackup

Keep your application settings in sync (OS X/Linux)
GNU General Public License v3.0
14.52k stars 930 forks source link

Post restore hooks / git sub modules? #1700

Open lougreenwood opened 3 years ago

lougreenwood commented 3 years ago

Some of my apps make use of plugins, these plugins are stored as git submodules.

Currently I use the dotbot tool to manage these configs, since it can pull these git submodules, but since trying out mackup, I see that it's a better tool for my workflow and it would be great to manage these configs which rely in git submodules with Mackup.

I checked the docs and I don't see any mention of git submodule support, but I figured one generic way of supporting this could be with custom application configs and some support for a kind of "post restore" hook, where I can configure git to pull these sub modules.

Has anything like this been considered?

lra commented 3 years ago

No. Mackup try to stay agnostic about the way you store your files. It does not sync config files, it moves config files where you want to sync them. If you want to use git and git submodules, just use the basic file_system engine, and point it to your git repo, it will just move the config files there.

lougreenwood commented 3 years ago

Thanks for the reply (and your work on making such a clean backup tool) but I think you may have misunderstood (or maybe just I misunderstand the purpose of Mackup)?

I'm already using the file system config. What I'm looking for is a single source of truth for how to back and restore those config files. I would like a custom application config to encapsulate what is backed up and actions to be performed after restoring these files to also be definable in the application config.

I can also achieve this with some custom post install scripting, but now the concerns are fragmented between a custom application config and some external script.

If there were hooks which can be executed after a restore occurs, I can have mackup manage both the fit submodules and the pull of the sub modules on restore, simply by running mackup restore.

Does that make sense?

lra commented 3 years ago

Yes, I don't think that should be the purpose of Mackup, or at least until it handles the syncing of files itself. For now, I suggest tweaking your shell to have such a behavior, as I don't see a good way to generalize something like this.