diff options
author | Robin Schneider <ypid@riseup.net> | 2018-05-21 19:10:17 +0200 |
---|---|---|
committer | Robin Schneider <ypid@riseup.net> | 2020-01-03 22:35:13 +0100 |
commit | 138fdbc8d7f42bd54e0a1d0c07d5858b1055ea50 (patch) | |
tree | 75fdb0dfcb6458ac90e7930047b00d3870624fff /dotbot/dispatcher.py | |
parent | e38e021ab324ea676a285ac4667f1fba1469a6bf (diff) |
Add 'canonicalize-path' option to link
Dotbot had a hardcoded behaviour that the BASEDIR was always passed to
os.path.realpath which "returns the canonical path of the specified
filename, eliminating any symbolic links encountered in the path".
This might not always be desirable so this commit makes it configurable.
The use case where `canonicalize-path` comes in handy is the following:
You want to provide dotfiles in the Filesystem Hierarchy Standard under
`/usr/local/share/ypid_dotfiles/`. Now you want to provide
`.config/dotfiles` as a default in `/etc/skel`. When you now
pre-configure `/etc/skel` by running dotbot in it set has HOME, dotfiles
will refer to `/usr/local/share/ypid_dotfiles/` and not
`/etc/skel/.config/dotfiles` which does not look nice.
This is related to but not the same as the `relative` parameter used
with link commands.
Diffstat (limited to 'dotbot/dispatcher.py')
-rw-r--r-- | dotbot/dispatcher.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dotbot/dispatcher.py b/dotbot/dispatcher.py index d1a4f95..36eac02 100644 --- a/dotbot/dispatcher.py +++ b/dotbot/dispatcher.py @@ -10,8 +10,8 @@ class Dispatcher(object): self._load_plugins() def _setup_context(self, base_directory): - path = os.path.abspath(os.path.realpath( - os.path.expanduser(base_directory))) + path = os.path.abspath( + os.path.expanduser(base_directory)) if not os.path.exists(path): raise DispatchError('Nonexistent base directory') self._context = Context(path) |