public static int runCommand(String command, Path directory, Appendable output, Map<String, String> env) {
        List<String> finalizedCommand;
        if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).startsWith("windows")) {
            finalizedCommand = Arrays.asList("cmd.exe", "/c", command);
        } else {
            finalizedCommand = Arrays.asList("sh", "-c", command);
        }
        return runCommand(finalizedCommand, directory, output, env);
    }
Helper to run a process.

<p>stderr is redirected to stdout when writing to {@code output}.
This method <em>does not</em> throw when a non-zero exit code is
encountered. For any more complex use cases, use {@link ProcessBuilder}
directly.

@param command   String that contains the command and arguments of the command.
@param directory Directory to use as the working directory.
@param output    Sink destination for lines from stdout and stderr of the process.
@param env       Environment variables to set, possibly overriding specific inherited variables.
@return          Returns the exit code of the process.
smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java