fixed compiler warnings

i18n
michal 3 years ago
parent 0dd1cac395
commit 7e358e1513

@ -1,6 +1,6 @@
[package]
name = "ame"
version = "2.4.0"
version = "2.4.1"
authors = [ "jnats <jnats@salyut.one>", "axtlos <axtlos@salyut.one>" ]
edition = "2018"
description = "a fast and efficient aur helper."

@ -8,11 +8,18 @@ pub fn rem_pkg(pkgs: &Vec<String>) {
let file = format!("{}/.local/ame/aurPkgs.db", std::env::var("HOME").unwrap());
let database = String::new();
if std::path::Path::new(&file).exists() {
let database = std::fs::read_to_string(&file).expect("Can't Open Database");
let _db = std::fs::read_to_string(&file);
match _db {
Ok(_) => {
inf(format!("Database parsed"))
}
Err(_) => {
err_unrec(format!("Couldn't open database"))
}
}
} else {
err_rec(String::from("Database wasn't found, creating new one"));
let dbFile = File::create(&file);
let database = String::new();
let _dbfile = File::create(&file);
}
let mut update_database = database;

@ -1,4 +1,3 @@
//use crate::mods::strs::{err_unrec, inf, sec, succ};
use crate::{
err_rec, err_unrec, inf, inssort, mods::strs::prompt, mods::strs::sec, mods::strs::succ, uninstall,
};
@ -31,12 +30,20 @@ pub fn upgrade(noconfirm: bool) {
let file = format!("{}/.local/ame/aurPkgs.db", std::env::var("HOME").unwrap());
let database = String::new();
if std::path::Path::new(&file).exists() {
let database = std::fs::read_to_string(&file).expect("Can't Open Database");
let _db = std::fs::read_to_string(&file).expect("Can't Open Database");
} else {
fs::create_dir_all(format!("/{}/.local/ame/", homepath));
let _cdar = fs::create_dir_all(format!("/{}/.local/ame/", homepath));
match _cdar {
Ok(_) => {
inf(format!("Created cache directory (previously missing)"))
}
Err(_) => {
err_unrec(format!("Couldn't create cache directory"))
}
}
err_rec(String::from("Database wasn't found, creating new one"));
let dbFile = std::fs::File::create(&file);
let database = String::new();
let _dbfile = std::fs::File::create(&file);
let _db = String::new();
}
let db_parsed = database.parse::<toml::Value>().expect("Invalid Database");

@ -3,7 +3,7 @@ use ansi_term::Colour;
pub fn ver() {
println!("");
inf(format!("ame - v2.4.0"));
inf(format!("ame - v2.4.1"));
println!("");
inf(format!("Contributors:"));
println!("- axtlos <axtlos@salyut.one>");

Loading…
Cancel
Save