Implement Scoop (fix #78)
This commit is contained in:
@@ -175,6 +175,12 @@ fn run() -> Result<(), Error> {
|
|||||||
&mut execution_context,
|
&mut execution_context,
|
||||||
)?);
|
)?);
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
report.push_result(execute(
|
||||||
|
|terminal| windows::run_scoop(terminal, opt.dry_run),
|
||||||
|
&mut execution_context,
|
||||||
|
)?);
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
report.push_result(execute(
|
report.push_result(execute(
|
||||||
|terminal| unix::run_homebrew(terminal, opt.dry_run),
|
|terminal| unix::run_homebrew(terminal, opt.dry_run),
|
||||||
|
|||||||
@@ -25,6 +25,31 @@ pub fn run_chocolatey(terminal: &mut Terminal, dry_run: bool) -> Option<(&'stati
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
|
pub fn run_scoop(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
|
||||||
|
if let Some(scoop) = utils::which("scoop") {
|
||||||
|
terminal.print_separator("Scoop");
|
||||||
|
|
||||||
|
let success = || -> Result<(), failure::Error> {
|
||||||
|
Executor::new(&scoop, dry_run)
|
||||||
|
.args(&["update"])
|
||||||
|
.spawn()?
|
||||||
|
.wait()?
|
||||||
|
.check()?;
|
||||||
|
Executor::new(&scoop, dry_run)
|
||||||
|
.args(&["update", "*"])
|
||||||
|
.spawn()?
|
||||||
|
.wait()?
|
||||||
|
.check()?;
|
||||||
|
Ok(())
|
||||||
|
}().is_ok();
|
||||||
|
|
||||||
|
return Some(("Scoop", success));
|
||||||
|
}
|
||||||
|
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Powershell {
|
pub struct Powershell {
|
||||||
path: Option<PathBuf>,
|
path: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user