Like GNU Stow but written in Rust.
Sync config files from a git repo by using symlinks. The program tries to imitate an UNIX like directory structure:
$HOME │ ├── irrelevant-file-or-dir0 ├── irrelevant-file-or-dir1 │ │ │ ├── sub0 ... │ └── subn ├── .config │ │ │ ├── sub0 ... │ └── subn ... │ └── irrelevant-file-or-dirn
Example:
- Download a repository.
- Run
synkronizer. - Resolve conflicts, if any.
- By default searches at
./config.txt. - Empty lines (or lines that contain only whitespace characters) and lines that begin with
#are ignored. This definition extends in this extreme case too. - The valid options (casing ignored) that can appear in the left hand side are:
HOME- which corresponds to files and directories inside~/, except~/.config.CONFIG- which corresponds to~/.config.CONFLICT_RESOLVER- set by default asPROMP. Other possibilities include:OVERWRITEandDO_NOTHING.
- The right hand side should have a valid path to the directory that we want to sync from.
- A
=separates both sides.
In case one instance of a config file or directory exists, the ConflictResolver enumeration
is used to resolve that conflict.
ConflictResolver::Prompt- is the default resolver. It prompts the user to answer if he wants to delete the current file/folder and replace it with a link to the file/folder in the repository.ConflictResolver::Overwrite- same as overwriting everything withConflictResolver::Prompt.ConflictResolver::DoNothing- same as skipping everything withConflictResolver::Prompt.
For the moment only a command line version is supported. GTK version is in TODO.
Testing requires source code to be mounted to a certain directory and a specific directory with subdirectories to exists. Refer to test.sh for the specific locations.
- Files which have spaces in their name.
- In case when you don’t want to sync
~/or~/.configmodify the source code and do not callApp::sync_[home|config](). - Config file uses
DO_NOTHINGto refer tolibsynkronizer::sync::ConflictResolver::DoNothing.