add method

  1. @override
Future<SimpleProcessResult> add({
  1. String? file,
  2. List<String>? files,
  3. bool? skipOnError,
  4. HandlerFunction? handlerFn,
  5. bool? showOutput,
})
inherited

Adds one or more files to be under source control

Implementation

@override
T add(
    {String? file,
    List<String>? files,
    bool? skipOnError,
    HandlerFunction? handlerFn,
    bool? showOutput}) {
  if (skipOnError == false &&
      ((file != null && files != null) || (file == null && files == null))) {
    throw SimpleProcessResult(
        processResult: ProcessResult(0, 1, '',
            'Please enter the file or files, and not both in same time'));
  }

  var f;
  if (file != null) {
    f = [file];
  } else {
    f = files;
  }

  return runner.run(
      args: ['add', ...?f],
      showOutput: showOutput,
      handlerFn: handlerFn,
      skipOnError: skipOnError);
}