Compare commits
No commits in common. "9c59a838ad7dc6ec46f63a4febbff55c0c6463ee" and "aa1057dbd82883f48f8a1999ccc6fc7ef0fb5203" have entirely different histories.
9c59a838ad
...
aa1057dbd8
1
src/apis/mod.rs
Normal file
1
src/apis/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod pacman;
|
@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
wrappers/pacman.rs
|
||||
This module provides a wrapper to make working with Pacman much easier.
|
||||
pacman.rs
|
||||
This module provides an api to make working with Pacman much easier.
|
||||
*/
|
||||
|
||||
use std::{error, fmt, result};
|
||||
@ -87,12 +87,6 @@ pub fn remove_unused(packages: Vec<String>) -> Result<()> {
|
||||
check_exit_code(exit_status)
|
||||
}
|
||||
|
||||
pub fn clean_cache() -> Result<()> {
|
||||
let exit_status = shell_commands::execute_in_sh("sudo pacman -Scc")?;
|
||||
|
||||
check_exit_code(exit_status)
|
||||
}
|
||||
|
||||
fn check_exit_code(exit_status: ExitStatus) -> Result<()> {
|
||||
if !exit_status.success() {
|
||||
let exit_code = match exit_status.code() {
|
10
src/main.rs
10
src/main.rs
@ -13,10 +13,10 @@
|
||||
|
||||
use colored::{ColoredString, Colorize};
|
||||
|
||||
use wrappers::pacman;
|
||||
use apis::pacman;
|
||||
|
||||
mod apis;
|
||||
mod shell_commands;
|
||||
mod wrappers;
|
||||
|
||||
fn main() {
|
||||
println!("{}", copyright_notice());
|
||||
@ -50,12 +50,6 @@ fn main() {
|
||||
return;
|
||||
}
|
||||
|
||||
notice_println("Clearing Cache");
|
||||
if let Err(e) = pacman::clean_cache() {
|
||||
error_println(e.to_string());
|
||||
return;
|
||||
}
|
||||
|
||||
notice_println("\nUpdate process complete!");
|
||||
}
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
Rust Arch Linux Updater
|
||||
Copyright (C) 2024 Luke Harding <luke@lukeh990.io>
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
wrappers/mod.rs
|
||||
Just makes pacman accessible
|
||||
*/
|
||||
|
||||
pub mod pacman;
|
Loading…
x
Reference in New Issue
Block a user