Skip to content

Commit

Permalink
create config path folder if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff committed Aug 18, 2023
1 parent 57c7efa commit 33a420e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ impl Config {
/// The assets macro will read the config from the global config file and set the assets serve location to the value in the config.
pub fn save(&self) {
let config = toml::to_string(&self).unwrap();
std::fs::write(config_path(), config).unwrap();
let config_path = config_path();
std::fs::create_dir_all(config_path.parent().unwrap()).unwrap();
std::fs::write(config_path, config).unwrap();
}
}

Expand Down

0 comments on commit 33a420e

Please sign in to comment.