buildVarsInMap function
Implementation
void buildVarsInMap(Map<String, String> map) {
var varsKeys = <String, Map<String, String>>{};
for (var key in map.keys) {
var val = map[key]!;
if (val.contains('{{')) {
var res = captureVars(val);
if (res.vars.isNotEmpty) {
varsKeys[key] = res.vars;
/// replace contents of file for upload.
map[key] = res.text;
}
}
}
entryDataHasVars = varsKeys.isNotEmpty;
if (entryDataHasVars) {
var varsContent = json2yaml(
varsKeys,
yamlStyle: YamlStyle.generic,
);
// trace('Vars content: ', varsContent);
saveString(config.inputVarsFile, varsContent);
trace(
'Found ${varsKeys.keys.length} key(s) with placeholders.\n - ${config.inputVarsFile}:');
}
}