public static synchronized void addActionCommands(@NotNull List<? extends ActionCommand> commands) throws IOException {
    if (Boolean.getBoolean(STARTUP_WIZARD_MODE)) {
      for (ActionCommand command : commands) {
        command.execute();
      }
    }
    else {
      List<ActionCommand> script = new ArrayList<>(), originalScript = null;
      Path scriptFile = getActionScriptFile();
      if (Files.exists(scriptFile)) {
        originalScript = loadActionScript(scriptFile);
        script.addAll(originalScript);
      }
      script.addAll(commands);

      try {
        saveActionScript(script, scriptFile);
      }
      catch (Throwable t) {
        if (originalScript != null) {
          try {
            saveActionScript(originalScript, scriptFile);
          }
          catch (Throwable tt) { t.addSuppressed(tt); }
        }
        throw t;
      }
    }
  }
public static synchronized void addActionCommands(@NotNull List<? extends ActionCommand> commands)