All actions in the following scripts are performed according to structure of dotfiles.
checkHealth.sh
shows status of filesfileBackup.sh
create backup to folder$HOME/back/TIMESTAMP_backconfig
with timestamp if not symlinkfileRemove.sh
remove regular files, if existing on systemfileRestore.sh
write files, if nonexisting on system, from backup by argument the folder namesymlinkInstall.sh
create symlinks and also create folders with symlinkssymlinkUninstall.sh
remove symlinks
- coreutils: http://git.savannah.gnu.org/gitweb/?p=coreutils.git (untested for other utils)
- readlink to follow symbolic links
- realpath to resolve non-canonical paths provided by fd-find
- fd-find: https://github.com/sharkdp/fd (cargo install fd-find) for convenient ignorelist
- fd returns relative paths prefixed with ./ to prevent -files from modifying shell behavior
- POSIX-compatible shell, but should work on most other shells
Make sure to place this repository in ${HOME}/dotfiles
.
If you also like that this can not be checked in POSIX, let them know.
Make sure not to mess up your .bashrc
or equivalent of your login shell.
Keep a copy of your distro and files around on your first try to restore things.
To set an example for proper handling, we use readlink and realpath from coreutils.
This is a fundamental limitation of any program printing folder and file names,
since -filenames
are not considered as special.
However they can break programs.
Example: ls "${filename}"
with filename being -k
leading to tls -k
.
See also sharkdp/fd#760 and
https://dwheeler.com/essays/fixing-unix-linux-filenames.html#dashes