Skip to content

Commit

Permalink
prompt user on windows before adding to HKEY_CURRENT_USER\Environment…
Browse files Browse the repository at this point in the history
…\Path
  • Loading branch information
dsp committed Feb 17, 2024
1 parent 4180e41 commit 07c5547
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rye/src/cli/rye.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,18 @@ fn add_rye_to_path(mode: &InstallMode, shims: &Path, ask: bool) -> Result<(), Er
#[cfg(windows)]
{
crate::utils::windows::add_to_programs(rye_home)?;
crate::utils::windows::add_to_path(rye_home)?;

if matches!(mode, InstallMode::NoPrompts)
|| !ask
|| dialoguer::Confirm::with_theme(tui_theme())
.with_prompt(format!(
"Should the installer add Rye to {}?",
style("HKEY_CURRENT_USER\\Environment\\PATH").cyan()
))
.interact()?
{
crate::utils::windows::add_to_path(rye_home)?;
}
}
Ok(())
}
Expand Down

0 comments on commit 07c5547

Please sign in to comment.