You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.
Q: Is there a way to write the entire current configuration object to its local source files?
My scenario is thus:
I want to be able to introduce and remove settings following a software publishing update. To do this I will need to merge the local configuration with the new one, ensuring common settings are kept but new ones added and if a setting is no longer in the new config it gets removed form the local config. So I merge the configurations as such:
var config = Config.Create(() => new ConfigSettings(), defaultAppSettings, defaultUserSettings,
localAppSettings, localUserSettings);
Where defaultAppSettings, defaultUserSettings, localAppSettings, and localUserSettings are strings.
Is this correct?
Now I would like to save the merged configuration back to the local files. Can I do this in one operation?
Or is there already a way to do this 'updating' in Nett.Coma?
The text was updated successfully, but these errors were encountered:
Coma currently does not support such upgrade scenarios. So there is no ‘easy’ way I can think of to achieve this.
Also be careful, Default settings are not meant to get merged. The default setting files should get written once, and from there on be used as the ‘local’ settings that get merged to a single ‘local’ settings object.
Then only way I can think of is to do something like this.
void UpgradeSettingsToV2() {
TomlTable currentConfig = Toml.ReadFile(“localuserconfig.toml”);
TomlTable v2DefaultConfig = Toml.ReadString(DefaultUserConfig);
TomlTable v2CompatibleUserSettings = Merge(currentConfig, v2DefaultConfig);
Toml.Writefile(v2CompatibleUserSettings “localuserconfig.toml”);
// do the same for app settings…
}
The issue is, that you would need to implement the ‘Merge’ operation yourself. Implementing such a merge operation correctly is no easy task.
I’ll put new items for such upgrade scenarios into my backlog.
Best Regards,
Philipp
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: donvreug<mailto:notifications@github.com>
Sent: Sonntag, 14. Mai 2017 01:21
To: paiden/Nett<mailto:Nett@noreply.github.com>
Cc: Subscribed<mailto:subscribed@noreply.github.com>
Subject: [paiden/Nett] Write entire configuration to source files (#27)
I am using Nett.Coma.
Q: Is there a way to write the entire current configuration object to its local source files?
My scenario is thus:
I want to be able to introduce and remove settings following a software publishing update. To do this I will need to merge the local configuration with the new one, ensuring common settings are kept but new ones added and if a setting is no longer in the new config it gets removed form the local config. So I merge the configurations as such:
var config = Config.Create(() => new ConfigSettings(), defaultAppSettings, defaultUserSettings,
localAppSettings, localUserSettings);
Where defaultAppSettings, defaultUserSettings, localAppSettings, and localUserSettings are strings.
Is this correct?
Now I would like to save the merged configuration back to the local files. Can I do this in one operation?
Or is there already a way to do this 'updating' in Nett.Coma?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#27>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHT2ef0akyLyHyt5ciikxDvKBtq9FmRKks5r5jrXgaJpZM4NaOML>.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using Nett.Coma.
Q: Is there a way to write the entire current configuration object to its local source files?
My scenario is thus:
I want to be able to introduce and remove settings following a software publishing update. To do this I will need to merge the local configuration with the new one, ensuring common settings are kept but new ones added and if a setting is no longer in the new config it gets removed form the local config. So I merge the configurations as such:
var config = Config.Create(() => new ConfigSettings(), defaultAppSettings, defaultUserSettings,
localAppSettings, localUserSettings);
Where defaultAppSettings, defaultUserSettings, localAppSettings, and localUserSettings are strings.
Is this correct?
Now I would like to save the merged configuration back to the local files. Can I do this in one operation?
Or is there already a way to do this 'updating' in Nett.Coma?
The text was updated successfully, but these errors were encountered: