Cargo fmt
This commit is contained in:
@@ -125,7 +125,10 @@ fn run() -> Result<(), Error> {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
report.push_result(execute(|| unix::run_homebrew(opt.cleanup, opt.run_type), opt.no_retry)?);
|
report.push_result(execute(|| unix::run_homebrew(opt.cleanup, opt.run_type), opt.no_retry)?);
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
report.push_result(execute(|| freebsd::upgrade_packages(&sudo, opt.run_type), opt.no_retry)?);
|
report.push_result(execute(
|
||||||
|
|| freebsd::upgrade_packages(&sudo, opt.run_type),
|
||||||
|
opt.no_retry,
|
||||||
|
)?);
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
report.push_result(execute(|| unix::run_nix(opt.run_type), opt.no_retry)?);
|
report.push_result(execute(|| unix::run_nix(opt.run_type), opt.no_retry)?);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Option<(&'s
|
|||||||
|
|
||||||
if let Some(sudo) = sudo {
|
if let Some(sudo) = sudo {
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(sudo)
|
run_type
|
||||||
|
.execute(sudo)
|
||||||
.args(&["/usr/sbin/freebsd-update", "fetch", "install"])
|
.args(&["/usr/sbin/freebsd-update", "fetch", "install"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
@@ -34,7 +35,8 @@ pub fn upgrade_packages(sudo: &Option<PathBuf>, run_type: RunType) -> Option<(&'
|
|||||||
|
|
||||||
if let Some(sudo) = sudo {
|
if let Some(sudo) = sudo {
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(sudo)
|
run_type
|
||||||
|
.execute(sudo)
|
||||||
.args(&["/usr/sbin/pkg", "upgrade"])
|
.args(&["/usr/sbin/pkg", "upgrade"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ pub fn upgrade_macos(run_type: RunType) -> Option<(&'static str, bool)> {
|
|||||||
print_separator("App Store");
|
print_separator("App Store");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute("softwareupdate")
|
run_type
|
||||||
|
.execute("softwareupdate")
|
||||||
.args(&["--install", "--all"])
|
.args(&["--install", "--all"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ pub fn run_chocolatey(run_type: RunType) -> Option<(&'static str, bool)> {
|
|||||||
print_separator("Chocolatey");
|
print_separator("Chocolatey");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(&choco)
|
run_type
|
||||||
|
.execute(&choco)
|
||||||
.args(&["upgrade", "all"])
|
.args(&["upgrade", "all"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
@@ -34,12 +35,9 @@ pub fn run_scoop(run_type: RunType) -> Option<(&'static str, bool)> {
|
|||||||
print_separator("Scoop");
|
print_separator("Scoop");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(&scoop)
|
run_type.execute(&scoop).args(&["update"]).spawn()?.wait()?.check()?;
|
||||||
.args(&["update"])
|
run_type
|
||||||
.spawn()?
|
.execute(&scoop)
|
||||||
.wait()?
|
|
||||||
.check()?;
|
|
||||||
run_type.execute(&scoop)
|
|
||||||
.args(&["update", "*"])
|
.args(&["update", "*"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
@@ -104,7 +102,8 @@ impl Powershell {
|
|||||||
print_separator("Powershell Modules Update");
|
print_separator("Powershell Modules Update");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(&powershell)
|
run_type
|
||||||
|
.execute(&powershell)
|
||||||
.arg("Update-Module")
|
.arg("Update-Module")
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
@@ -126,7 +125,8 @@ impl Powershell {
|
|||||||
print_separator("Windows Update");
|
print_separator("Windows Update");
|
||||||
|
|
||||||
let success = || -> Result<(), Error> {
|
let success = || -> Result<(), Error> {
|
||||||
run_type.execute(&powershell)
|
run_type
|
||||||
|
.execute(&powershell)
|
||||||
.args(&["-Command", "Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -Verbose"])
|
.args(&["-Command", "Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -Verbose"])
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
use crate::executor::{RunType};
|
use crate::executor::RunType;
|
||||||
use crate::terminal::print_separator;
|
use crate::terminal::print_separator;
|
||||||
use crate::utils::{which, Check, PathExt};
|
use crate::utils::{which, Check, PathExt};
|
||||||
use directories::BaseDirs;
|
use directories::BaseDirs;
|
||||||
@@ -55,7 +55,8 @@ fn nvimrc(base_dirs: &BaseDirs) -> Option<PathBuf> {
|
|||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn upgrade(vim: &PathBuf, vimrc: &PathBuf, plugin_framework: PluginFramework, run_type: RunType) -> Result<(), Error> {
|
fn upgrade(vim: &PathBuf, vimrc: &PathBuf, plugin_framework: PluginFramework, run_type: RunType) -> Result<(), Error> {
|
||||||
run_type.execute(&vim)
|
run_type
|
||||||
|
.execute(&vim)
|
||||||
.args(&[
|
.args(&[
|
||||||
"-N",
|
"-N",
|
||||||
"-u",
|
"-u",
|
||||||
|
|||||||
Reference in New Issue
Block a user