1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 16:14:45 +00:00
This commit is contained in:
deadc0de6
2021-11-01 21:39:42 +01:00
parent 42dc86366e
commit 9d9077cc3f

View File

@@ -382,7 +382,7 @@ def cmd_install(opts):
def _workdir_enum(opts):
workdir_files = []
for root, dirs, files in os.walk(opts.workdir):
for root, _, files in os.walk(opts.workdir):
for file in files:
fpath = os.path.join(root, file)
workdir_files.append(fpath)
@@ -401,20 +401,20 @@ def _workdir_enum(opts):
# recursive
pattern = '{}/*'.format(newpath)
files = workdir_files.copy()
for f in files:
if fnmatch.fnmatch(f, pattern):
workdir_files.remove(f)
for file in files:
if fnmatch.fnmatch(file, pattern):
workdir_files.remove(file)
# only checks children
children = [f.path for f in os.scandir(newpath)]
for c in children:
if c in workdir_files:
workdir_files.remove(c)
for child in children:
if child in workdir_files:
workdir_files.remove(child)
else:
if newpath in workdir_files:
workdir_files.remove(newpath)
for w in workdir_files:
for wfile in workdir_files:
line = '=> \"{}\" does not exist in dotdrop'
LOG.log(line.format(w))
LOG.log(line.format(wfile))
return len(workdir_files)
@@ -463,8 +463,7 @@ def cmd_compare(opts, tmp):
same = False
cnt += 1
# TODO
if _workdir_enum(opts) > 0:
if _workdir_enum(opts) > 0:
same = False
LOG.log('\n{} dotfile(s) compared.'.format(cnt))