Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno task: recursive task always fuzzy matches and runs unwanted tasks in child projects #27401

Closed
WilcoKruijer opened this issue Dec 17, 2024 · 1 comment · Fixed by #27396
Closed
Labels
bug Something isn't working correctly task runner related to deno task

Comments

@WilcoKruijer
Copy link

When working with workspaces, running deno task -r <task> will fuzzy match for the name of the task. This is unexpected and inconvenient when working with a common NodeJS script naming convention where we have a task named lint for linting once, and a task named lint:watch for lint & watching. Because of the fuzzy match, deno task -r lint would start watchers and not actually lint all sub-projects.

To reproduce, run the following:

cd /tmp && \
mkdir -p deno-workspace-repro/app1 && \
cd deno-workspace-repro/app1 && \
deno init && \
cd ..  && \
echo '{ "workspace": ["./app1"] }' > deno.json

Now observe that running deno task -r d will start the dev task.

Version: Deno 2.1.4

@bartlomieju
Copy link
Member

Same problem as in #27370

@bartlomieju bartlomieju added bug Something isn't working correctly task runner related to deno task labels Dec 17, 2024
dsherret pushed a commit that referenced this issue Jan 9, 2025
This commit fixes `deno task` by checking if the provided
task name actually has a wildcard char ("*").

Previously, if the "--recursive" flag was passed, the task name
was treated as a regex, which lead to a situation where exact task
name resulted in a regex that matched all tasks with the specific
prefix.

This commit fixes it, by checking if the provided task name, is an exact
name, or is it a wildcard match.

Closes #27370
Closes #27401
Closes #27408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly task runner related to deno task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants