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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user