@Override
  public void main(@NotNull List<String> args) {
    if (Boolean.getBoolean(AppMode.FORCE_PLUGIN_UPDATES)) {
      logInfo("Plugin updates are applied");
      System.exit(0);
    }

    final InternalPluginResults updateCheckResult;
    final Collection<PluginDownloader> availableUpdates;
    try {
      updateCheckResult = ApplicationManager.getApplication().executeOnPooledThread(
          () -> UpdateChecker.getInternalPluginUpdates()
        ).get();
    }
    catch (InterruptedException | ExecutionException e) {
      LOG.error("Failed to check plugin updates", e);
      System.exit(1);
      return;
    }
    if (!updateCheckResult.getErrors().isEmpty()) {
      LOG.warn("Errors occurred during the update check: " +
               ContainerUtil.map(updateCheckResult.getErrors().entrySet(), entry -> "host=" + entry.getKey() + ": " + entry.getValue().getMessage()));
    }

    availableUpdates = updateCheckResult.getPluginUpdates().getAllEnabled();
    if (availableUpdates.isEmpty()) {
      logInfo("all plugins up to date");
      System.exit(0);
      return;
    }
    Collection<PluginDownloader> pluginsToUpdate;
    if (args.size() > 1) {
      Set<String> filter = new HashSet<>(args.subList(1, args.size()));
      pluginsToUpdate = availableUpdates.stream()
        .filter(downloader -> filter.contains(downloader.getId().getIdString()))
        .toList();
    }
    else {
      pluginsToUpdate = availableUpdates;
    }

    logInfo("Plugins to update: " +
            ContainerUtil.map(pluginsToUpdate, downloader -> downloader.getPluginName() + " version " + downloader.getPluginVersion()));

    final boolean installed;
    try {
      installed = ApplicationManager.getApplication().executeOnPooledThread(
          () -> UpdateInstaller.installPluginUpdates(pluginsToUpdate, new EmptyProgressIndicator())
        ).get();
    }
    catch (InterruptedException | ExecutionException e) {
      LOG.error("Failed to install plugin updates", e);
      System.exit(1);
      return;
    }

    if (installed) {
      logInfo("Plugin updates are prepared to be installed");
      System.exit(0);
    }
    else {
      LOG.warn("Update failed");
      System.exit(1);
    }
  }
@Override
  public void main(@NotNull List<String> args)