execute method

  1. @override
bool execute(
  1. ReleasePacker releasePacker,
  2. Directory rootDirectory, {
  3. ReleaseBundle? releaseBundle,
  4. int expectedExitCode = 0,
})
override

Implementation

@override
bool execute(ReleasePacker releasePacker, Directory rootDirectory,
    {ReleaseBundle? releaseBundle, int expectedExitCode = 0}) {
  var dartPath = whichExecutablePath('dart');

  print(
      '   »  Dart command> ${rootDirectory.path} -> $dartPath $command $args');

  var result = Process.runSync(dartPath, [command, ...args],
      workingDirectory: rootDirectory.path);

  var exitCode = result.exitCode;
  var ok = exitCode == expectedExitCode;

  if (!ok) {
    print(
        '  ▒  Dart command error! exitCode: $exitCode ; command: $command $args');
    print(result.stdout);
    print(result.stderr);
  }

  return ok;
}