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
We've come across a situation where we have a config that needs to be identical to another one (and stay identical if changes are made) except for one value
Currently I'm using plutil to override the value just before calling configen but this is quite hacky. So I see there are two options:
Allow overriding a key value on the command line, eg:
The key of the base plist being something like :super, :inherit_from or :base etc. But starting with a character like : that makes it an invalid swift variable name.
That way the generated config.swift from config.plist is:
class Config {
static let KEY1 = "VALUE1"
static let KEY2 = "NEW_VALUE2"
}
I think the latter plist inheritance option would be preferable as it keeps all the values in the plists and there's no chance of one hiding in a script somewhere. Would this be desirable to implement and create a pull request?
The text was updated successfully, but these errors were encountered:
I think it's a good idea, but have you considered having two plist files (and changing the values you want to be different in the other plist file) and switching between them?
(I'm sure you have, but just asking anyway. I am interesting in learning about the reasons why that is not preferable in your scenario, apart from things getting duplicated).
We've come across a situation where we have a config that needs to be identical to another one (and stay identical if changes are made) except for one value
Currently I'm using plutil to override the value just before calling configen but this is quite hacky. So I see there are two options:
Allow overriding a key value on the command line, eg:
configen -p "$configLocation" -h "$configDir/Config.map" -n $configName -o "$configDir" --override KEY VALUE
Inheriting from another plist, eg:
baseconfig.plist
config.plist:
The key of the base plist being something like
:super
,:inherit_from
or:base
etc. But starting with a character like:
that makes it an invalid swift variable name.That way the generated config.swift from config.plist is:
I think the latter plist inheritance option would be preferable as it keeps all the values in the plists and there's no chance of one hiding in a script somewhere. Would this be desirable to implement and create a pull request?
The text was updated successfully, but these errors were encountered: