aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/README.md
blob: 6d22e81eecf9479eeb0fbd47c52cdbef45667d84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Configuration file management
=============================

An easy but slightly too cumbersome to use tool to store & synchronize various
configuration files across multiple machines.
Actual configuration files are stored somewhere else (in a separate repository
perhaps) in directories which names must roughly match the `%.+%` regular
expression.
The part between the percent signs is the name of an environment variable.
Every file in such directory gets a symlink in the directory pointed to by the
environment variable.
Directory hierarchies are preserved.

For example, here's a possible representation of the "%PROGRAMDATA%" directory:

    %PROGRAMDATA%/
    └── a
        └── b
            └── c
                └── test.txt

This tool would create a symlink "C:\ProgramData\a\b\c\test.txt" pointing to
"%PROGRAMDATA%\a\b\c\test.txt", wherever "%PROGRAMDATA%" is stored.

A database of symlinks is maintained in case a configuration file is deleted
(the corresponding symlink is then deleted too).
Default database file name is "db.bin".

Usage
-----

    usage: update.sh [-d|--database PATH] [-s|--source DIR] [-n|--dry-run] [-h|--help]

To update the symlinks, run `./update.sh -d test.bin -s test`, substituting the
database file name for `test.bin` and directory path for `test`.
Requires Cygwin.

Limitations
-----------

Only alphanumeric variable names are supported.
Speaking more precisely, directory names must match the
`^%[_[:alpha:]][_[:alnum:]]*%$` regular expression.
This means that, for example, the environment variable `ProgramFiles(x86)` is
not supported.

License
-------

Distributed under the MIT License.
See [LICENSE.txt] for details.

[LICENSE.txt]: LICENSE.txt