class ShellCommandUtil {

  public static Result mkdir(String directoryPath, boolean sudo) throws IOException, InterruptedException {

    // If this directory already exists, do not try to create it
    if (pathExists(directoryPath, sudo).isSuccessful()) {
      return new Result(0, "The directory already exists, skipping.", ""); // Success!
    } else {
      ArrayList<String> command = new ArrayList<>();

      command.add("/bin/mkdir");

      if (!WINDOWS) {
        command.add("-p"); // create parent directories
      }

      command.add(directoryPath);

      return runCommand(command, null, null, sudo);
    }
  }

}