Fix/winget (#670)
* cargo update
* Remove the check for 'winget_enable' set to 'true'. On my Windows 10 and 11 machines, there are no issues with Winget anymore. As far as I remember, it was disabled by default because it was buggy back then.
* remove print_warning
* Revert "cargo update"
This reverts commit 5f4e532bc1.
* Removed the `enable_winget = true` configuration as winget is now enabled by default.
* Removed the #[cfg(windows)] flag.
* Revised as Recommended
* Wrapping at 80
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
# Configutation
|
||||||
|
|
||||||
|
1. The `enable_winget` configuration entry in the `windows` section has been
|
||||||
|
removed because it will not cause any issues and will be enabled by default.
|
||||||
|
|||||||
@@ -184,9 +184,6 @@
|
|||||||
# manager such as Scoop or Cargo
|
# manager such as Scoop or Cargo
|
||||||
# self_rename = true
|
# self_rename = true
|
||||||
|
|
||||||
# Enable WinGet upgrade
|
|
||||||
# enable_winget = true
|
|
||||||
|
|
||||||
|
|
||||||
[npm]
|
[npm]
|
||||||
# Use sudo if the NPM directory isn't owned by the current user
|
# Use sudo if the NPM directory isn't owned by the current user
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ pub struct Windows {
|
|||||||
accept_all_updates: Option<bool>,
|
accept_all_updates: Option<bool>,
|
||||||
self_rename: Option<bool>,
|
self_rename: Option<bool>,
|
||||||
open_remotes_in_new_terminal: Option<bool>,
|
open_remotes_in_new_terminal: Option<bool>,
|
||||||
enable_winget: Option<bool>,
|
|
||||||
wsl_update_pre_release: Option<bool>,
|
wsl_update_pre_release: Option<bool>,
|
||||||
wsl_update_use_web_download: Option<bool>,
|
wsl_update_use_web_download: Option<bool>,
|
||||||
}
|
}
|
||||||
@@ -1446,16 +1445,6 @@ impl Config {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
pub fn enable_winget(&self) -> bool {
|
|
||||||
return self
|
|
||||||
.config_file
|
|
||||||
.windows
|
|
||||||
.as_ref()
|
|
||||||
.and_then(|w| w.enable_winget)
|
|
||||||
.unwrap_or(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn enable_pipupgrade(&self) -> bool {
|
pub fn enable_pipupgrade(&self) -> bool {
|
||||||
return self
|
return self
|
||||||
.config_file
|
.config_file
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use tracing::debug;
|
|||||||
|
|
||||||
use crate::command::CommandExt;
|
use crate::command::CommandExt;
|
||||||
use crate::execution_context::ExecutionContext;
|
use crate::execution_context::ExecutionContext;
|
||||||
use crate::terminal::{print_separator, print_warning};
|
use crate::terminal::print_separator;
|
||||||
use crate::utils::{require, which};
|
use crate::utils::{require, which};
|
||||||
use crate::{error::SkipStep, steps::git::Repositories};
|
use crate::{error::SkipStep, steps::git::Repositories};
|
||||||
use crate::{powershell, Step};
|
use crate::{powershell, Step};
|
||||||
@@ -42,11 +42,6 @@ pub fn run_winget(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
|
|
||||||
print_separator("winget");
|
print_separator("winget");
|
||||||
|
|
||||||
if !ctx.config().enable_winget() {
|
|
||||||
print_warning("Winget is disabled by default. Enable it by setting enable_winget=true in the [windows] section in the configuration.");
|
|
||||||
return Err(SkipStep(String::from("Winget is disabled by default")).into());
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.run_type()
|
ctx.run_type()
|
||||||
.execute(winget)
|
.execute(winget)
|
||||||
.args(["upgrade", "--all"])
|
.args(["upgrade", "--all"])
|
||||||
|
|||||||
Reference in New Issue
Block a user