linux-china / task-keeper

A cli to manage tasks from different task runners or package managers
Apache License 2.0
22 stars 3 forks source link

Runs multiple tasks if they have the same name #10

Open tennox opened 8 months ago

tennox commented 8 months ago

If I have a task dev in e.g. package.json & Taskfile.yaml, it will run both. This is undesirable for me (and I feel like it used to be different?), as I often define tasks in both places, but the Taskfile would e.g. have pnpm install as dependency, and then run the pnpm run dev task (from package.json).

I don't see a clear way to define precedence between the task managers (config file / Env var TK_PREFER_MANAGERS?), but for this to be useful to me it would need something to change :thinking:

linux-china commented 8 months ago

It's some some hard to fix this problem, and you can use tk --runner=task hello to task in Taskfile.yaml. I will think about it and find a good solution to fix this problem.

tennox commented 4 months ago

I'd propose:

linux-china commented 4 months ago

How about following flow:

image

tennox commented 4 months ago

How about following flow

Looks about right... I do agree with putting Readme in the generic category as I've learnt it does require to specifically mark a readme code fence as a task. One thing I'm a bit unclear about though: what do you mean by alphabet: a-z ? I don't think the lexical order should have anything to do with selection..?

Also, just in case you were planning to put the diagram in the readme - it doesn't clearly state what happens if neither --all nor --runner are given - the arrow might benefit from a description "Select first by precedence", and positioning the env var descriptions related to that, not next to "all runners" flow - but this does not matter too much imo, just my two cents :tipping_hand_man: