void (@NotNull File shellcheck, @NotNull Runnable onSuccess, @NotNull Runnable onFailure) { try { String path = ShSettings.getShellcheckPath(); String shellcheckPath = shellcheck.getPath(); if (StringUtil.isNotEmpty(path) && path.equals(shellcheckPath)) { LOG.debug("Shellcheck already downloaded"); } else { ShSettings.setShellcheckPath(shellcheckPath); } if (!shellcheck.canExecute()) FileUtil.setExecutable(shellcheck); ApplicationManager.getApplication().invokeLater(onSuccess); } catch (IOException e) { LOG.warn("Can't evaluate shellcheck path or make it executable", e); ApplicationManager.getApplication().invokeLater(onFailure); } }