Skip to content

Commit

Permalink
correctly import symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Sep 11, 2017
1 parent a4721ad commit a14aeed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dotdrop/dotdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ def importer(opts, conf, paths):
LOG.dry('would run: %s' % (' '.join(cmd)))
else:
utils.run(cmd, raw=False, log=False)
if opts['link']:
cmd = ['mv', '%s' % (dst), '%s' % (srcf)]
else:
cmd = ['cp', '-r', '%s' % (dst), '%s' % (srcf)]
cmd = ['cp', '-r', '-L', dst, srcf]
if opts['dry']:
LOG.dry('would run: %s' % (' '.join(cmd)))
if opts['link']:
LOG.dry('would symlink %s to %s' % (srcf, dst))
else:
utils.run(cmd, raw=False, log=False)
if opts['link']:
utils.remove(dst)
os.symlink(srcf, dst)
LOG.sub('\"%s\" imported' % (path))
cnt += 1
Expand Down

0 comments on commit a14aeed

Please sign in to comment.