10.12.3 Process

Haxe supports the spawning and management of new processes using the Process class, here's an example of running a git command and reading its output:

class Main {
  static function main() {
    final gitCommand = 'git log --format=short --no-decorate -n1 --oneline';
    final process = new sys.io.Process(gitCommand);
    if (process.exitCode() != 0) {
      trace("Error running process command");
    }
    final lastCommitInfo = process.stdout.readLine();
    trace(lastCommitInfo);
    process.close();
  }
}