void (@NotNull File formatter, @NotNull Runnable onSuccess, @NotNull Runnable onFailure) { try { String formatterPath = formatter.getCanonicalPath(); if (ShSettings.getShfmtPath().equals(formatterPath)) { LOG.info("Shfmt formatter already downloaded"); } else { ShSettings.setShfmtPath(formatterPath); } if (!formatter.canExecute()) FileUtil.setExecutable(formatter); ApplicationManager.getApplication().invokeLater(onSuccess); } catch (IOException e) { LOG.warn("Can't evaluate formatter path or make it executable", e); ApplicationManager.getApplication().invokeLater(onFailure); } }