Closed parker789 closed 5 years ago
This should work, what version of dotdrop are you using and which installation method do you use (submodule, pypi, etc)?
Here's what I tried with dotdrop latest version from git master:
$ tree /tmp/config
/tmp/config
├── dir1
│ └── a
├── dir2
│ └── b
├── file
└── newfile
$ ./dotdrop.sh import -l link_children /tmp/config
$ rm dotfiles/tmp/config/newfile
$ rm -r dotfiles/tmp/config/dir2
$ ./dotdrop.sh install
$ tree /tmp/config
/tmp/config
├── dir1 -> /home/user/dotdrop/dotfiles/tmp/config/dir1
├── dir2
│ └── b
├── file -> /home/user/dotdrop/dotfiles/tmp/config/file
└── newfile
The config file for reference:
dotfiles:
d_config:
src: tmp/config
dst: /tmp/config
link: link_children
profiles:
qube:
dotfiles:
- d_config
config:
backup: true
link_on_import: nolink
dotpath: dotfiles
longkey: false
create: true
banner: true
link_dotfile_default: nolink
keepdot: false
Moreover dotdrop should ask you before erasing any file, something like this:
Remove "/tmp/config/file" for link creation? [y/N] ? y
-> linked /tmp/config/file to /home/user/dotdrop/dotfiles/tmp/config/file
Remove "/tmp/config/dir1" for link creation? [y/N] ? y
-> linked /tmp/config/dir1 to /home/user/dotdrop/dotfiles/tmp/config/dir1
oh sorry I misread your explanation, your issue is on the nvim
subdir ....
Actually link_children
will only link direct children of the dotfile, not recursively. Since nvim
is a child of ~/.config
it will link it to dotdrop and therefore removing the original ~/.config/nvim
.
Yes one solution is to manage each subdirs separately. BTW link_children
was initially done for vim
: https://github.com/deadc0de6/dotdrop/wiki/symlinked-dotfiles
Any specific behavior you were actually expecting?
yeah, right now i'm using link_children
for ~/.config/nvim
and it's working as expected. I was just trying to condense my config.yaml down to 1 item for all my entire config directory. It's not a bad thing to split everything out into their own apps though. I'm pretty sure you answered my question!
What I am trying to achieve I'm trying to link my entire ~/.config directory at once with link_children, so that when calling
dotdrop install
only those files which are present inside my dotpath get symlinked, and don't alter any other files within ~/.configWhat I have tried so far After running
dotdrop import -l link_children ~/.config
I get the following directory structure within my dotpath:Now.. I dont wan't a few folders handled by dotpath, so I remove them..
cd ~/dotfiles/dotfiles/.config && rm -rf coc configstore dotdrop nvim/autoload nvim/plugged
. Now I have this dir:Looks good! These are the files I want managed by dotdrop, so now I run
dotdrop install
which causes all the subdirectories to be symlinked:At this point the subdirectories are symlinked and my original .config files have been overwritten.
nvim/autoload
andnvim/plugged
have been removed from~/.config
because they don't exist within the dotpath. Also, when I re-install the correct files within autoload/plugged, they are automatically added back into the dotpath folder. For now I've moved away from this entire .config link_children approach and am linking each subdirectory individually (d_alacritty, d_bat, d_neofetch, d_nvim).. which works, but I was j/w if this was possible.