CommandStep.fromString constructor

CommandStep.fromString(
  1. String label,
  2. String command, {
  3. List<String> extraArguments = const [],
})

Creates the step from a command written as a single string, such as the build_command of a platform

The extraArguments are appended to the arguments of the command

Implementation

factory CommandStep.fromString(String label, String command, {List<String> extraArguments = const []}) {
  List<String> parts = ProcessHelper.splitCommand(command);
  return CommandStep(
    label,
    executable: parts.isEmpty ? "" : parts.first,
    arguments: [...parts.skip(1), ...extraArguments],
  );
}