public static String runCommand(String command, Path directory) {
        StringBuilder sb = new StringBuilder();
        int exitValue = runCommand(command, directory, sb);

        if (exitValue != 0) {
            throw new RuntimeException(String.format(
                    "Command `%s` failed with exit code %d and output:%n%n%s",
                    command,
                    exitValue,
                    sb));
        }

        return sb.toString();
    }
Helper to run a process.

<p>stderr is redirected to stdout in the return value of this method.

@param command   String that contains the command and arguments of the command.
@param directory Directory to use as the working directory.
@return          Returns the combined stdout and stderr of the process.
@throws RuntimeException if the process returns a non-zero exit code or fails.
smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java