Skip to content
Snippets Groups Projects
Commit 5cdec468 authored by bjorn3's avatar bjorn3
Browse files

Reserialize filesystem.toml instead of copying the original config

This will be necessary to handle including other configs from the config
to use as these configs will not be copied.
parent c9e091be
No related branches found
No related tags found
1 merge request!29Support including other config files from a config file
......@@ -55,7 +55,7 @@ fn main() {
// Add filesystem.toml to config
config.files.push(redox_installer::FileConfig {
path: "filesystem.toml".to_string(),
data: config_data,
data: toml::to_string_pretty(&config).unwrap(),
..Default::default()
});
......
......@@ -29,7 +29,7 @@ fn chown<P: AsRef<Path>>(path: P, uid: uid_t, gid: gid_t, recursive: bool) -> Re
Ok(())
}
#[derive(Clone, Debug, Default, Deserialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FileConfig {
pub path: String,
pub data: String,
......
#[derive(Clone, Debug, Default, Deserialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct GeneralConfig {
pub prompt: bool,
// Allow config to specify cookbook recipe or binary package as default
......
......@@ -5,7 +5,7 @@ pub mod file;
pub mod package;
pub mod user;
#[derive(Clone, Debug, Default, Deserialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Config {
pub general: general::GeneralConfig,
#[serde(default)]
......
#[derive(Clone, Debug, Deserialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum PackageConfig {
Empty,
......
#[derive(Clone, Debug, Default, Deserialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UserConfig {
pub password: Option<String>,
pub uid: Option<u32>,
......
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