mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-07 21:29:22 +00:00
allow relative workdir and fix lstrip for home
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -89,7 +89,6 @@ class TestConfig(unittest.TestCase):
|
||||
|
||||
# test profile
|
||||
opts = conf.get_settings()
|
||||
print(conf.get_profiles())
|
||||
profiles = conf.get_profiles()
|
||||
self.assertTrue(pf1key in profiles)
|
||||
self.assertTrue(pf2key in profiles)
|
||||
|
||||
Reference in New Issue
Block a user