prepareShellExecutable method

Future<ProcessResult> prepareShellExecutable({
  1. required String file,
  2. required String outFile,
})

Implementation

Future<ProcessResult> prepareShellExecutable({
  required String file,
  required String outFile,
}) async {
  if (fs.file(outFile) case final file when !file.existsSync()) {
    file.createSync(recursive: true);
  }

  await fs.file(file).copy(outFile);

  final process = ctor(
    'chmod',
    ['+x', outFile],
    includeParentEnvironment: true,
    runInShell: false,
  );

  return process;
}