mirror of
https://github.com/denoland/deno.git
synced 2025-02-01 20:25:12 -05:00
This reverts commit 0742ea1170
.
Closes https://github.com/denoland/deno/issues/18466
This commit is contained in:
parent
7ec45770c8
commit
cbd14085e6
1 changed files with 3 additions and 5 deletions
|
@ -265,15 +265,13 @@ pub async fn upgrade(
|
||||||
) -> Result<(), AnyError> {
|
) -> Result<(), AnyError> {
|
||||||
let ps = ProcState::build(flags).await?;
|
let ps = ProcState::build(flags).await?;
|
||||||
let current_exe_path = std::env::current_exe()?;
|
let current_exe_path = std::env::current_exe()?;
|
||||||
let output_exe_path =
|
let metadata = fs::metadata(¤t_exe_path)?;
|
||||||
upgrade_flags.output.as_ref().unwrap_or(¤t_exe_path);
|
|
||||||
let metadata = fs::metadata(output_exe_path)?;
|
|
||||||
let permissions = metadata.permissions();
|
let permissions = metadata.permissions();
|
||||||
|
|
||||||
if permissions.readonly() {
|
if permissions.readonly() {
|
||||||
bail!(
|
bail!(
|
||||||
"You do not have write permission to {}",
|
"You do not have write permission to {}",
|
||||||
output_exe_path.display()
|
current_exe_path.display()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
@ -284,7 +282,7 @@ pub async fn upgrade(
|
||||||
"You don't have write permission to {} because it's owned by root.\n",
|
"You don't have write permission to {} because it's owned by root.\n",
|
||||||
"Consider updating deno through your package manager if its installed from it.\n",
|
"Consider updating deno through your package manager if its installed from it.\n",
|
||||||
"Otherwise run `deno upgrade` as root.",
|
"Otherwise run `deno upgrade` as root.",
|
||||||
), output_exe_path.display());
|
), current_exe_path.display());
|
||||||
}
|
}
|
||||||
|
|
||||||
let client = &ps.http_client;
|
let client = &ps.http_client;
|
||||||
|
|
Loading…
Add table
Reference in a new issue