[solana-install-init] Optimize error message for Windows user permission installation (#234)
* feat: check user's permissions in Windows * feat: Remove check fun and check os_err * fmt and optimize code
This commit is contained in:
parent
1fc4e38a4f
commit
a71a62f2e2
|
@ -1171,13 +1171,17 @@ pub fn init_or_update(config_file: &str, is_init: bool, check_only: bool) -> Res
|
|||
release_dir.join("solana-release"),
|
||||
config.active_release_dir(),
|
||||
)
|
||||
.map_err(|err| {
|
||||
format!(
|
||||
.map_err(|err| match err.raw_os_error() {
|
||||
#[cfg(windows)]
|
||||
Some(os_err) if os_err == winapi::shared::winerror::ERROR_PRIVILEGE_NOT_HELD => {
|
||||
"You need to run this command with administrator privileges.".to_string()
|
||||
}
|
||||
_ => format!(
|
||||
"Unable to symlink {:?} to {:?}: {}",
|
||||
release_dir,
|
||||
config.active_release_dir(),
|
||||
err
|
||||
)
|
||||
),
|
||||
})?;
|
||||
|
||||
config.save(config_file)?;
|
||||
|
|
Loading…
Reference in New Issue