setConfig function
void
setConfig(
- ArgResults res
Reads the config
from res
Implementation
void setConfig(ArgResults res) {
if (res.wasParsed('config')) {
startConfig(res['config']);
} else {
readPubSpec();
var ftsKey = pubSpecMap['fts'];
if (ftsKey != null) {
if (ftsKey is String) {
/// path.
startConfig(ftsKey);
} else if (ftsKey is YamlMap) {
/// map.
loadEnv(parsedDoc: ftsKey);
} else {
error("Invalid `fts` key in pubspec.yaml");
exit(1);
}
} else {
startConfig('trconfig.yaml');
}
}
}