|
|
@ -36,8 +36,8 @@ pub fn printconfig() {
|
|
|
|
let mut confile = File::open("/etc/ame.toml").expect("Unable to open the Config file, did you delete ame.toml from /etc/??");
|
|
|
|
let mut confile = File::open("/etc/ame.toml").expect("Unable to open the Config file, did you delete ame.toml from /etc/??");
|
|
|
|
let mut config = String::new();
|
|
|
|
let mut config = String::new();
|
|
|
|
let conftostring = fs::read_to_string("/etc/ame.toml").expect("unable to open config file!");
|
|
|
|
let conftostring = fs::read_to_string("/etc/ame.toml").expect("unable to open config file!");
|
|
|
|
let configfile: General = toml::from_str(r#"
|
|
|
|
let defaultconfig = format!(r#"
|
|
|
|
cache = "/home/user/.cache/ame"
|
|
|
|
cache = "{}/.cache/ame"
|
|
|
|
|
|
|
|
|
|
|
|
[backends]
|
|
|
|
[backends]
|
|
|
|
pacman = true
|
|
|
|
pacman = true
|
|
|
@ -49,8 +49,9 @@ pub fn printconfig() {
|
|
|
|
noconfirm = false
|
|
|
|
noconfirm = false
|
|
|
|
|
|
|
|
|
|
|
|
[aur]
|
|
|
|
[aur]
|
|
|
|
clone_path = "/home/user/.cache/ame"
|
|
|
|
clone_path = "{}/.cache/ame"
|
|
|
|
"#).unwrap();
|
|
|
|
"#, std::env::var("HOME").unwrap(), std::env::var("HOME").unwrap());
|
|
|
|
|
|
|
|
let configfile: General = toml::from_str(&defaultconfig).unwrap();
|
|
|
|
if conftostring != "" {
|
|
|
|
if conftostring != "" {
|
|
|
|
confile.read_to_string(&mut config).expect("Unable to read the Config file");
|
|
|
|
confile.read_to_string(&mut config).expect("Unable to read the Config file");
|
|
|
|
let configfile: General = toml::from_str(&config).unwrap();
|
|
|
|
let configfile: General = toml::from_str(&config).unwrap();
|
|
|
|