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:
Nils
2024-02-03 02:09:47 +01:00
committed by GitHub
parent 3c970063a9
commit 7007e76ab5
4 changed files with 5 additions and 20 deletions

View File

@@ -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.

View File

@@ -184,9 +184,6 @@
# manager such as Scoop or Cargo
# self_rename = true
# Enable WinGet upgrade
# enable_winget = true
[npm]
# Use sudo if the NPM directory isn't owned by the current user

View File

@@ -198,7 +198,6 @@ pub struct Windows {
accept_all_updates: Option<bool>,
self_rename: Option<bool>,
open_remotes_in_new_terminal: Option<bool>,
enable_winget: Option<bool>,
wsl_update_pre_release: Option<bool>,
wsl_update_use_web_download: Option<bool>,
}
@@ -1446,16 +1445,6 @@ impl Config {
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 {
return self
.config_file

View File

@@ -8,7 +8,7 @@ use tracing::debug;
use crate::command::CommandExt;
use crate::execution_context::ExecutionContext;
use crate::terminal::{print_separator, print_warning};
use crate::terminal::print_separator;
use crate::utils::{require, which};
use crate::{error::SkipStep, steps::git::Repositories};
use crate::{powershell, Step};
@@ -42,11 +42,6 @@ pub fn run_winget(ctx: &ExecutionContext) -> Result<()> {
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()
.execute(winget)
.args(["upgrade", "--all"])