[feature] Better support for nvim/zsh plugins as submodules
It would be nice to have a configuration option that allows users to specify directories for which dotdrop install handles installations at the directory level, rather than for each file.
For example, I manage my Neovim and Zsh plugins as Git submodules within my dotfiles repository. For these plugin directories specifically, it would be helpful if dotdrop install prompted for confirmation once per directory and removed existing files on the install directory
Indeed, there is no such config right now that allows to treat a directory dotfile as a single block instead of its components (files and directories).
However you could potentially use trans_install to produce the same kind of effect:
trans_install:
directory_block_handle: "rm -rf {{@@ _dotfile_abs_dst @@}}; cp -r {0} {1}"
dotfiles:
d_directory:
src: tmp/directory
dst: /tmp/directory
trans_install: directory_block_handle
I agree it's hacky but it works. What the above does is removing entirely the directory destination using a trans_install directive.
A trans_install is supposed to produce a transformed version of the dotfile into a temporary directory thus the use of cp -r {0} {1}.
Does the above solution work for you?
Yes, the solution you suggested does work, but as you mentioned, it is rather hacky. I can already see myself spending an hour debugging after dotdrop compare unexpectedly removes my plugin directories 😅.