builder: Add pacdiff builder
parent
8c35eb1250
commit
07486a5430
@ -1,4 +1,5 @@
|
||||
pub mod git;
|
||||
pub mod makepkg;
|
||||
pub mod pacdiff;
|
||||
pub mod pacman;
|
||||
pub mod pager;
|
||||
|
@ -0,0 +1,27 @@
|
||||
use crate::internal::{
|
||||
commands::{ShellCommand, StringOutput},
|
||||
error::{AppError, AppResult, SilentUnwrap},
|
||||
exit_code::AppExitCode,
|
||||
};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct PacdiffBuilder {}
|
||||
|
||||
impl PacdiffBuilder {
|
||||
pub async fn list() -> AppResult<StringOutput> {
|
||||
let result = ShellCommand::pacdiff()
|
||||
.args(&["-o", "-f"])
|
||||
.elevated()
|
||||
.wait_with_output()
|
||||
.await?;
|
||||
if result.status.success() {
|
||||
Ok(result)
|
||||
} else {
|
||||
Err(AppError::Other(result.stderr))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn pacdiff() -> AppResult<()> {
|
||||
ShellCommand::pacdiff().elevated().wait_success().await
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue