1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 17:24:46 +00:00

ask before dereferencing symlinks for #184

This commit is contained in:
deadc0de6
2020-11-05 22:25:31 +01:00
parent 8bc6519a25
commit 204871e725
2 changed files with 9 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ It can be changed:
The `import` command imports dotfiles to be managed by dotdrop.
It copies the dotfile to your `dotpath` and updates the config file with the new entry.
Note that dotdrop will dereference all symlinks when importing a file or directory.
Dotdrop will ask for dereferencing symlinks on import unless `-f --force` is used.
For example to import `~/.xinitrc`
```bash

View File

@@ -374,6 +374,14 @@ def cmd_importer(o):
dst = path.rstrip(os.sep)
dst = os.path.abspath(dst)
if o.safe:
# ask for symlinks
realdst = os.path.realpath(dst)
if dst != realdst:
msg = '\"{}\" is a symlink, dereference it and continue?'
if not LOG.ask(msg.format(dst)):
continue
src = strip_home(dst)
if o.import_as:
# handle import as