LocalExecutionEnv constructor

LocalExecutionEnv({
  1. String? cwd,
  2. Shell? shell,
  3. Future<int?> diskFreeProbe(
    1. String directory
    )?,
})

Creates a LocalExecutionEnv rooted at cwd.

A custom shell may be provided to swap the default LocalShell for a sandboxed WASM shell on mobile targets. diskFreeProbe backs the job-log low-disk guard of the default shell (issue #919); injectable for tests, ignored when shell is given.

Implementation

LocalExecutionEnv({String? cwd, Shell? shell, this.diskFreeProbe})
  : _fs = LocalFileSystem(cwd: cwd),
    _shell =
        shell ??
        (diskFreeProbe == null
            ? const LocalShell()
            : LocalShell(diskFreeProbe: diskFreeProbe));