serviceHomeDir method

String serviceHomeDir(
  1. ServiceDescriptor d
)

The directory holding the service's per-role state: OMNYSHELL_HOME when the descriptor sets it, else %LOCALAPPDATA%\OmnyShell (falling back to %APPDATA%, then the system temp dir).

Implementation

String serviceHomeDir(svc.ServiceDescriptor d) {
  final home = d.environment['OMNYSHELL_HOME'];
  if (home != null && home.isNotEmpty) return home;
  final local =
      Platform.environment['LOCALAPPDATA'] ??
      Platform.environment['APPDATA'] ??
      Directory.systemTemp.path;
  return '$local\\OmnyShell';
}