diff --git a/README.md b/README.md index b4ae518..3a06625 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ mapped to extended configuration dictionaries. | `relink` | Removes the old target if it's a symlink (default: false) | | `force` | Force removes the old target, file or folder, and forces a new link (default: false) | | `relative` | Use a relative path to the source when creating the symlink (default: false, absolute links) | -| `canonicalize-path` | Resolve any symbolic links encountered in the source to symlink to the canonical path (default: true, real paths) | +| `canonicalize` | Resolve any symbolic links encountered in the source to symlink to the canonical path (default: true, real paths) | | `glob` | Treat a `*` character as a wildcard, and perform link operations on all of those matches (default: false) | | `if` | Execute this in your `$SHELL` and only link if it is successful. | | `ignore-missing` | Do not fail if the source is missing and create the link anyway (default: false) | diff --git a/dotbot/plugins/link.py b/dotbot/plugins/link.py index ee257f7..0d195fe 100644 --- a/dotbot/plugins/link.py +++ b/dotbot/plugins/link.py @@ -27,7 +27,8 @@ class Link(dotbot.Plugin): for destination, source in links.items(): destination = os.path.expandvars(destination) relative = defaults.get('relative', False) - canonical_path = defaults.get('canonicalize-path', True) + # support old "canonicalize-path" key for compatibility + canonical_path = defaults.get('canonicalize', defaults.get('canonicalize-path', True)) force = defaults.get('force', False) relink = defaults.get('relink', False) create = defaults.get('create', False) @@ -39,7 +40,7 @@ class Link(dotbot.Plugin): # extended config test = source.get('if', test) relative = source.get('relative', relative) - canonical_path = source.get('canonicalize-path', canonical_path) + canonical_path = source.get('canonicalize', source.get('canonicalize-path', canonical_path)) force = source.get('force', force) relink = source.get('relink', relink) create = source.get('create', create) @@ -123,7 +124,7 @@ class Link(dotbot.Plugin): return basename else: return source - + def _create_glob_results(self, path, exclude_paths): self._log.debug("Globbing with path: " + str(path)) base_include = glob.glob(path) diff --git a/test/tests/link-no-canonicalize.bash b/test/tests/link-no-canonicalize.bash index 7f516c6..a65e397 100644 --- a/test/tests/link-no-canonicalize.bash +++ b/test/tests/link-no-canonicalize.bash @@ -3,6 +3,7 @@ test_description='linking path canonicalization can be disabled' test_expect_success 'setup' ' echo "apple" > ${DOTFILES}/f && +echo "grape" > ${DOTFILES}/g && ln -s dotfiles dotfiles-symlink ' @@ -21,3 +22,19 @@ ${DOTBOT_EXEC} -c ./dotfiles-symlink/${INSTALL_CONF} test_expect_success 'test' ' [ "$(readlink ~/.f | cut -d/ -f5-)" = "dotfiles-symlink/f" ] ' + +test_expect_success 'run 2' ' +cat > "${DOTFILES}/${INSTALL_CONF}" <