You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
636 B
Rust
22 lines
636 B
Rust
use std::fs::File;
|
|
use toml::value::{Array, Table};
|
|
use serde_derive::{Serialize, Deserialize};
|
|
|
|
#[derive(Serialize, Deserialize, Debug)]
|
|
pub(crate) struct Config {
|
|
pub(crate) base_package_path: String,
|
|
pub(crate) installation_path: String,
|
|
pub(crate) key_verification: bool
|
|
}
|
|
impl Default for Config {
|
|
fn default() -> Self {
|
|
Config {
|
|
base_package_path: "/packages".to_string(),
|
|
installation_path: "/var/gaypk/".to_string(),
|
|
key_verification: true
|
|
}
|
|
}
|
|
}
|
|
pub(crate) fn read_config() -> Config {
|
|
toml::from_str("/cfg/gaypk/config.toml").expect("Parse failed!")
|
|
} |