Open Jon889 opened 4 years ago
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?