← back to roto on ba3a.dev

ProcessRunner

fun interface ProcessRunner

Runs an external program to completion. The one seam between Roto and the programs it drives — ffmpeg, ffprobe, a project's afterPublish command, the artist's chosen editor — so a test can stand in for the program.

Inheritors

Functions

Link copied to clipboard
abstract fun run(command: List<String>, workingDirectory: Path?): ProcessResult

Runs command (the program, then its arguments) in workingDirectory — Roto's own when null — with no input, and waits for it to exit. Throws an IOException when the program cannot be started, for example because it is not on PATH; a program that starts and then fails is a ProcessResult with a non-zero exit code.