clone method

Future<bool> clone(
  1. String localDirectoryToCloneInto,
  2. String repository
)

Clones a repository by git clone into the specified localDirectoryToCloneInto folder. If the localDirectoryToCloneInto does not exist, it will be created. Returns true if the command was successful, false if failed for any reason.

Implementation

Future<bool> clone(
    String localDirectoryToCloneInto, String repository) async {
  await Directory(localDirectoryToCloneInto).create(recursive: true);
  ProcessResult processResult = await git_service.runGit(
      ['clone', repository],
      throwOnError: false,
      echoOutput: false,
      processWorkingDir: localDirectoryToCloneInto);

  return processResult.exitCode == 0;
}