CliTool constructor

CliTool({
  1. required String executable,
  2. int? windowsCodePage = WindowsCodePage.utf8,
})

Implementation

CliTool({
  required String executable,
  this.windowsCodePage = WindowsCodePage.utf8,
}) : originalExecutable = executable {
  if (io.Platform.isWindows && null != windowsCodePage) {
    final script = createWindowsScript(
      windowsCodePage: windowsCodePage,
      contents: """
REM Forward arguments to the actual executable
$executable %*
""",
    );
    this.executable = script.path;
  } else {
    this.executable = executable;
  }
}