yadm-dev / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.11k stars 175 forks source link

Deleting symlinks when run under sudo #473

Closed Matt-Deacalion closed 8 months ago

Matt-Deacalion commented 11 months ago

I sometimes use sudo -E vim <file> to edit root owned files, while maintaining my editor's configuration. I noticed that with the vim-signify plugin, all of my yadm symlinks get wiped out whenever I do this. This is because it performs a yadm diff on startup, which removes symlinks when run with sudo -E.

$ ls -l ~/.vimrc
lrwxrwxrwx 1 matt matt 14 Dec  5 10:52 .vimrc -> .vimrc##u.matt

$ sudo -E yadm diff
<snipped>

$ ls -l ~/.vimrc
ls: cannot access '.vimrc': No such file or directory

I fixed this by running:

$ yadm config local.user $(id -un)

Just posting this in case anybody else has a similar problem. Thank you for this tool, it's brilliant.

rasa commented 11 months ago

@Matt-Deacalion yadm config yadm.alt-copy true would fix this issue, as well.

github-actions[bot] commented 9 months ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been labeled as stale for 7 days with no activity.