resolveWriteScope method

Future<ConfigScope> resolveWriteScope(
  1. ConfigScope? scope, {
  2. String? key,
})

Resolves the write scope: an explicit scope wins. By default the project-capable sections (memory/cube/tools) belong in the project file (created when absent); everything else belongs in the user file.

Implementation

Future<ConfigScope> resolveWriteScope(
  ConfigScope? scope, {
  String? key,
}) async {
  if (scope != null) return scope;
  if (key != null && _projectSections.contains(key.split('.').first)) {
    return ConfigScope.project;
  }
  return ConfigScope.global;
}