1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 09:04:18 +00:00
This commit is contained in:
deadc0de6
2018-04-10 23:05:45 +02:00
parent 1d51bdb5c5
commit a49d0c5096

View File

@@ -12,7 +12,7 @@ from docopt import docopt
# local imports # local imports
try: try:
from . import __version__ as VERSION from . import __version__ as VERSION
except: except ImportError:
errmsg = ''' errmsg = '''
Dotdrop has been updated to be included in pypi and Dotdrop has been updated to be included in pypi and
the way it needs to be called has slightly changed. the way it needs to be called has slightly changed.
@@ -182,15 +182,15 @@ def update(opts, conf, path):
path = path.lstrip(home) path = path.lstrip(home)
path = os.path.join(TILD, path) path = os.path.join(TILD, path)
dotfiles = conf.get_dotfiles(opts['profile']) dotfiles = conf.get_dotfiles(opts['profile'])
l = [d for d in dotfiles if d.dst == path] subs = [d for d in dotfiles if d.dst == path]
if not l: if not subs:
LOG.err('\"%s\" is not managed!' % (path)) LOG.err('\"%s\" is not managed!' % (path))
return False return False
if len(l) > 1: if len(subs) > 1:
found = ','.join([d.src for d in dotfiles]) found = ','.join([d.src for d in dotfiles])
LOG.err('multiple dotfiles found: %s' % (found)) LOG.err('multiple dotfiles found: %s' % (found))
return False return False
dotfile = l[0] dotfile = subs[0]
src = os.path.join(conf.get_abs_dotpath(opts['dotpath']), dotfile.src) src = os.path.join(conf.get_abs_dotpath(opts['dotpath']), dotfile.src)
if Templategen.get_marker() in open(src, 'r').read(): if Templategen.get_marker() in open(src, 'r').read():
LOG.warn('\"%s\" uses template, please update manually' % (src)) LOG.warn('\"%s\" uses template, please update manually' % (src))