diff --git a/src/main/java/org/rundeck/client/tool/commands/Projects.java b/src/main/java/org/rundeck/client/tool/commands/Projects.java index 95c2e715..a95fccca 100644 --- a/src/main/java/org/rundeck/client/tool/commands/Projects.java +++ b/src/main/java/org/rundeck/client/tool/commands/Projects.java @@ -125,7 +125,13 @@ public boolean delete(ProjectDelete options, CommandOutput output) throws IOExce String project = projectOrEnv(options); if (!options.isConfirm()) { //request confirmation - String s = System.console().readLine("Really delete project %s? (y/N) ", project); + Console console = System.console(); + String s = "n"; + if (null != console) { + s = console.readLine("Really delete project %s? (y/N) ", project); + } else { + output.warning("No console input available, and --confirm/-y was not set."); + } if (!"y".equals(s)) { output.warning(String.format("Not deleting project %s.", project));