added flatpak install method

i18n
axtloss 3 years ago
parent 16c38b3d9b
commit fe741b862f

@ -22,6 +22,7 @@ Made for crystalux, compatible with any arch-based linux distribution.</p>
| Action | Command | Shorthand alias | Supported pacman equivalent |
| ------ | ------ | ------ | ------ |
| Install a package | amethyst install | ame ins | -S |
| Install a package via flatpak | amethyst flat | ame flat | -f |
| Remove a package| amethyst remove | ame rm | -R |
| Update repository | amethyst update | ame upd | -Sy |
| Upgrade a package | amethyst upgrade | ame upg | -Syu |

@ -1,5 +1,5 @@
mod mods;
use mods::{clearcache::clearcache, clone::clone, help::help, install::install, search::{a_search, r_search}, uninstall::uninstall, upgrade::upgrade};
use mods::{clearcache::clearcache, clone::clone, help::help, install::install, search::{a_search, r_search}, uninstall::uninstall, upgrade::upgrade, flatpak::flatpak};
use std::{env, process::exit, process::Command};
fn main() {
@ -41,6 +41,10 @@ fn main() {
}
} else if oper == "-Cc" {
clearcache();
} else if oper == "-f" {
for arg in env::args().skip(2) {
flatpak(&arg);
}
} else {
help();
exit(0);

@ -4,4 +4,5 @@ pub mod help;
pub mod install;
pub mod search;
pub mod uninstall;
pub mod upgrade;
pub mod upgrade;
pub mod flatpak;

@ -15,7 +15,6 @@ pub fn clone(pkg: &str) {
println!("Installing {} ...", pkg);
Command::new("makepkg")
.current_dir(&cachedir)
.arg("--noconfirm")
.arg("-si")
.status()
.expect(&error);

@ -0,0 +1,11 @@
use std::process::Command;
pub fn flatpak(pkg:&str) {
let error = format!("Couldn't install {}", &pkg);
Command::new("flatpak")
.arg("install")
.arg(&pkg)
.status()
.expect(&error);
}

@ -2,6 +2,7 @@ pub fn help() {
println!("\
Usage:\n
ame -S <pkg> - install a package
ame -f <pkg> - install a package via flatpak
ame -R <pkg> - remove a package
ame -Syu - system upgrade
ame -Ss <pkg> - search for a package

Loading…
Cancel
Save