Hi,
Before every builds and for every projects, I have create this script to set my envars without to use that: VAR1 = [[parse cfg, get keyvalue return value]]
local deps_config_filename = _T("../../dependencies/dependencies.cfg");
local config_exist = IO.FileExists(deps_config_filename);
assert(config_exist);
if(config_exist)
{
local file_content = IO.ReadFileContents(deps_config_filename);
local groups = GetArrayFromString(file_content, _T("["), true);
for(local i = 0; i < groups.GetCount(); i++)
{
local group = GetArrayFromString(groups.Item(i), _T("]"), true);
local groupName = group.Item(0);
local values = GetArrayFromString(group.Item(1), _T("\n"), true);
print("groupName " + i + ": " + groupName);
for(local j = 0; j < values.GetCount(); j++)
{
local keyvalue = GetArrayFromString(values.Item(j), _T("="), true);
if(keyvalue.GetCount() != 2)
{
ShowError(_T("Pour le groupe: " + groupName + " et valeur: " + j + " il y a plus d'un charactère '='."));
}
for(local k = 0; k < keyvalue.GetCount(); k++)
{
local key = keyvalue.Item(0).MakeUpper();
local value = keyvalue.Item(1);
key = ::EscapeSpaces(key);
value = ::EscapeSpaces(value);
// $(key) = value;
print("key: " + key + " value: " + value));
}
}
}
}
But I don't know how to set the value.
$(key) = value;
Can you help me ?