Skip to content

fix(cli/run): resolve conflict when dir has same name as a task - #29538

Merged
dsherret merged 5 commits into
denoland:mainfrom
edilson258:fix/run-dirname-collision
Sep 3, 2025
Merged

dsherret merged 5 commits into
denoland:mainfrom
edilson258:fix/run-dirname-collision

Conversation

@edilson258

Copy link
Copy Markdown

Fixes: #28878

This PR fixes an issue where running deno run <name> would fail if a directory with the same name exists in the current working directory. This behavior is inconsistent with deno task, which correctly handles such cases by resolving the intended task path.

Please refer #28878 for a full description

@dsherret

Copy link
Copy Markdown
Contributor

Can you add a test to the tests/specs/run folder? To add a new test you just have to copy the same layout as the other folders then do cargo test <name_of_folder> to run the test

@edilson258
edilson258 force-pushed the fix/run-dirname-collision branch 2 times, most recently from a4549ff to ea196d8 Compare May 31, 2025 08:33
@edilson258

Copy link
Copy Markdown
Author

Can you add a test to the tests/specs/run folder? To add a new test you just have to copy the same layout as the other folders then do cargo test <name_of_folder> to run the test

Done

@edilson258
edilson258 force-pushed the fix/run-dirname-collision branch 2 times, most recently from fd42f4a to a800192 Compare June 2, 2025 07:50
@hansSchall

Copy link
Copy Markdown

I have tested it, LGTM

@edilson258
edilson258 force-pushed the fix/run-dirname-collision branch from a800192 to 34c58aa Compare June 3, 2025 13:57
@edilson258

Copy link
Copy Markdown
Author

@dsherret is there something else that we can do to get this merged??

@edilson258
edilson258 force-pushed the fix/run-dirname-collision branch from 34c58aa to 1d4085c Compare June 21, 2025 05:42
@edilson258
edilson258 force-pushed the fix/run-dirname-collision branch from 1d4085c to 027316b Compare June 30, 2025 07:21
@jeff-hykin

Copy link
Copy Markdown
Contributor

I was about to file an issue for this problem, thanks @edilson258 for making a PR!

Deno SvelteKit's says to deno run build, which works the first time, but then creates a ./build folder -- causes the 2nd run of deno run build to fail with a very confusing error. I'm trying to get a friend to switch to deno and this was the first issue he hit.

@dsherret dsherret added this to the 2.5.0 milestone Aug 29, 2025
Comment thread cli/main.rs Resolved

@dsherret dsherret left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

Will merge this before the release.

@dsherret
dsherret enabled auto-merge (squash) September 3, 2025 19:24
@dsherret
dsherret merged commit 2607bc7 into denoland:main Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using deno run instead of deno task fails if there is a dir with the same name as the task

5 participants