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

fix(install/global): do not error if path is an npm pkg and relative file #26975

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

dsherret
Copy link
Member

Closes #26969

@dsherret dsherret requested a review from bartlomieju November 21, 2024 16:23
cli.ts Outdated Show resolved Hide resolved
@dsherret dsherret enabled auto-merge (squash) November 21, 2024 16:25
"{entry_text} is missing a prefix. Did you mean `{}`?",
crate::colors::yellow(format!("deno install -g npm:{package_req}"))
);
if !cli_options.initial_cwd().join(entry_text).exists() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this going to hit the file system twice when the file exists? That seems like a redundant file operation to me

Copy link
Member Author

@dsherret dsherret Nov 21, 2024

Choose a reason for hiding this comment

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

It's fine. There won't be any noticable perf impact from one file system stat.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright

@dsherret dsherret merged commit 6ee8efc into denoland:main Nov 21, 2024
17 checks passed
@bartlomieju bartlomieju deleted the fix_install_error_npm_pkg_exists branch November 21, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants