getConfigPath method
Return the canonical file path for a configuration scope.
- ConfigScope.session: in-memory only, returns empty string.
Implementation
String getConfigPath({
ConfigScope scope = ConfigScope.global,
String? projectRoot,
}) {
switch (scope) {
case ConfigScope.global:
final home =
Platform.environment['HOME'] ??
Platform.environment['USERPROFILE'] ??
'.';
return '$home/.neomage/config.json';
case ConfigScope.project:
final root = projectRoot ?? Directory.current.path;
return '$root/.neomage/config.json';
case ConfigScope.session:
return ''; // session config is ephemeral
}
}