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

Revert "fix(cli): deno upgrade file permission (#18427)" #18467

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

bartlomieju
Copy link
Member

This reverts commit 0742ea1.

Closes #18466

CC @rottenpen

@@ -265,15 +265,13 @@ pub async fn upgrade(
) -> Result<(), AnyError> {
let ps = ProcState::build(flags).await?;
let current_exe_path = std::env::current_exe()?;
let output_exe_path =
upgrade_flags.output.as_ref().unwrap_or(&current_exe_path);
let metadata = fs::metadata(output_exe_path)?;
Copy link
Member

Choose a reason for hiding this comment

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

Can we just change this to never throw?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. The fix is easier than the revert.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I understand how to change that... metadata and permissions by extension are used further down in the file. How should that be changed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

At least a quick scroll down says that metadata is only used to check for permissions and root ownership. All of that is unnecessary if the file doesn't exist yet and thus could be handled in a if let Some() branch I think.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

Going to land this one for the release, but we should fix this properly in the future.

@dsherret dsherret merged commit cbd1408 into denoland:main Mar 31, 2023
mmastrac pushed a commit that referenced this pull request Mar 31, 2023
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.

deno upgrade --output: No such file or directory (os error 2)
3 participants