1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

allow relative workdir and fix lstrip for home

This commit is contained in:
deadc0de6
2018-12-27 09:32:08 +01:00
parent 0cb032f349
commit 8feb417ff6
8 changed files with 201 additions and 39 deletions

View File

@@ -11,6 +11,7 @@ import random
import tempfile
from dotdrop.config import Cfg
from dotdrop.utils import *
TMPSUFFIX = '.dotdrop'
@@ -96,11 +97,9 @@ def load_config(confpath, profile):
def get_path_strip_version(path):
'''Return the path of a file as stored in yaml config'''
strip = path
home = os.path.expanduser('~')
if strip.startswith(home):
strip = strip[len(home):]
return strip.lstrip('.' + os.sep)
path = strip_home(path)
path = path.lstrip('.' + os.sep)
return path
def get_dotfile_from_yaml(dic, path):