1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 06:08:03 +00:00

keep order of included profiles for #149

This commit is contained in:
deadc0de6
2019-06-02 13:31:36 +02:00
parent 8af57adfab
commit bebe6f5eae
5 changed files with 162 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ from dotdrop.templategen import Templategen
from dotdrop.installer import Installer
from dotdrop.updater import Updater
from dotdrop.comparator import Comparator
from dotdrop.utils import get_tmpdir, remove, strip_home, run
from dotdrop.utils import get_tmpdir, remove, strip_home, run, uniq_list
from dotdrop.linktypes import LinkTypes
LOG = Logger()
@@ -71,7 +71,8 @@ def cmd_install(o):
dotfiles = o.dotfiles
if o.install_keys:
# filtered dotfiles to install
dotfiles = [d for d in dotfiles if d.key in set(o.install_keys)]
uniq = uniq_list(o.install_keys)
dotfiles = [d for d in dotfiles if d.key in uniq]
if not dotfiles:
msg = 'no dotfile to install for this profile (\"{}\")'
LOG.warn(msg.format(o.profile))
@@ -388,7 +389,8 @@ def cmd_detail(o):
dotfiles = o.dotfiles
if o.detail_keys:
# filtered dotfiles to install
dotfiles = [d for d in dotfiles if d.key in set(o.details_keys)]
uniq = uniq_list(o.details_keys)
dotfiles = [d for d in dotfiles if d.key in uniq]
LOG.emph('dotfiles details for profile \"{}\":\n'.format(o.profile))
for d in dotfiles:
_detail(o.dotpath, d)