Skip to content
Snippets Groups Projects
Unverified Commit 19c7b598 authored by GyDi's avatar GyDi Committed by GitHub
Browse files

feat: compatible profile config

parent 749df892
No related branches found
No related tags found
No related merge requests found
...@@ -170,7 +170,21 @@ macro_rules! patch { ...@@ -170,7 +170,21 @@ macro_rules! patch {
impl Profiles { impl Profiles {
/// read the config from the file /// read the config from the file
pub fn read_file() -> Self { pub fn read_file() -> Self {
config::read_yaml::<Self>(dirs::profiles_path()) let mut profiles = config::read_yaml::<Self>(dirs::profiles_path());
if profiles.items.is_none() {
profiles.items = Some(vec![]);
}
profiles.items.as_mut().map(|items| {
for mut item in items.iter_mut() {
if item.uid.is_none() {
item.uid = Some(help::get_uid("d"));
}
}
});
profiles
} }
/// save the config to the file /// save the config to the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment