feat: add task tag
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
from ..entry import Entry, EntryDetector
|
||||
from ..entry import Entry, EntryDetector, TaskKey
|
||||
from ..pipe.core import PipeParser, PipeRunner
|
||||
from .resolve import PresetResolver, PresetResolverConfig
|
||||
|
||||
@@ -21,7 +21,7 @@ class PresetEntryDetector(EntryDetector):
|
||||
return None
|
||||
piperunner = PipeRunner(basepath)
|
||||
tasks = defaultdict(list)
|
||||
for preset in preset.presets.values():
|
||||
for tag, preset in preset.presets.items():
|
||||
if not piperunner.check_conditions(preset.conditions):
|
||||
continue
|
||||
for task_name, task_pack in preset.tasks.items():
|
||||
@@ -37,7 +37,7 @@ class PresetEntryDetector(EntryDetector):
|
||||
for k, v in task.variables.items()
|
||||
}
|
||||
)
|
||||
tasks[task_name] += [
|
||||
tasks[TaskKey(task_name, tag)] += [
|
||||
command.format(**variables) for command in task.commands
|
||||
]
|
||||
if tasks:
|
||||
|
||||
Reference in New Issue
Block a user