3 ms·
I do almost exactly the same as you; my install.sh is a glorified wrapper around `ln -s`, but for each file, it verifies whether the file is already symlinked a
by yjftsjthsd-h 8y ago
I do almost exactly the same as you; my install.sh is a glorified wrapper around `ln -s`, but for each file, it verifies whether the file is already symlinked and if not renames the original to something like `.foo.bak.$(date -I)`. This is probably overkill, but it was especially nice when I was just starting to version control my dotfiles and still found unmanaged files sometimes that contained things worth saving.
- joombaga 8y agoCan you share?
- yjftsjthsd-h 8y agoSure! https://gitlab.com/snippets/1844438 https://gitlab.com/snippets/1844438 EDIT: Some quirks to note, especially if you want to steal this script: 1. I use ~/.local/etc as my dotfile directory. 2. I support multiple shells but have all of them use ~/.profile rather than shell-specific files (most config overlaps, and there's a case stmt that deals with per-shell settings). 3. The vim/neovim bit at the bottom will fail silently if the directory already exists; thankfully this is rare, but it should be fixed some time.
- mikewhy 8y agoI do the same! https://github.com/mikew/dotfiles/blob/master/install.sh#L26-L29 https://github.com/mikew/dotfiles/blob/master/install.sh#L26... Although yours is more sound, I'm just moving files to `*.old`.
- jakeogh 8y agoheh. me too. https://github.com/jakeogh/symlinktree/blob/master/symlinktree/symlinktree.py https://github.com/jakeogh/symlinktree/blob/master/symlinktr...