scriptEnvironment method

Map<String, String> scriptEnvironment(
  1. Map<String, String> variables
)

The environment for a script's processes: variables with PATH starting at the dpk launcher when dpkCommand is set.

Implementation

Map<String, String> scriptEnvironment(Map<String, String> variables) {
  final command = dpkCommand;
  if (command == null) {
    return variables;
  }
  final path =
      variables['PATH'] ??
      environment['PATH'] ??
      Platform.environment['PATH'];
  return {
    ...variables,
    'PATH': prependToPath(writeDpkLauncher(command), path),
  };
}