TheLocehiliosan / yadm

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

Deleting symlinks when run under sudo #473

Closed Matt-Deacalion closed 4 months ago

Matt-Deacalion commented 7 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 7 months ago

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

github-actions[bot] commented 5 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 4 months ago

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