mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-08 08:29:17 +00:00
refactor and add more tests
This commit is contained in:
@@ -10,6 +10,8 @@ import string
|
||||
import random
|
||||
import tempfile
|
||||
|
||||
from dotdrop.config import Cfg
|
||||
|
||||
TMPSUFFIX = '.dotdrop'
|
||||
|
||||
|
||||
@@ -51,6 +53,17 @@ def create_dir(path):
|
||||
return path
|
||||
|
||||
|
||||
def load_config(confpath, dotpath, profile):
|
||||
'''Load the config file from path'''
|
||||
conf = Cfg(confpath, dotpath)
|
||||
opts = conf.get_configs()
|
||||
opts['dry'] = False
|
||||
opts['profile'] = profile
|
||||
opts['safe'] = True
|
||||
opts['installdiff'] = True
|
||||
return conf, opts
|
||||
|
||||
|
||||
def create_fake_config(folder, configname='config.yaml',
|
||||
dotpath='dotfiles', backup=True, create=True):
|
||||
'''Create a fake config file'''
|
||||
|
||||
Reference in New Issue
Block a user