From 31631440145ea2e26fccfcaeedf17f27b5071f9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 9 Jun 2011 20:54:54 +0200 Subject: [PATCH] Set an error code if project was not inserted successfully. This fixes #47. --- src/de/todesbaum/jsite/main/CLI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/de/todesbaum/jsite/main/CLI.java b/src/de/todesbaum/jsite/main/CLI.java index c97d8e1..2c5edbd 100644 --- a/src/de/todesbaum/jsite/main/CLI.java +++ b/src/de/todesbaum/jsite/main/CLI.java @@ -157,9 +157,11 @@ public class CLI implements InsertListener { } } + int errorCode = 1; if (currentProject != null) { if (insertProject(currentProject)) { outputWriter.println("Project \"" + currentProject.getName() + "\" successfully inserted."); + errorCode = 0; } else { outputWriter.println("Project \"" + currentProject.getName() + "\" was not successfully inserted."); } @@ -167,6 +169,8 @@ public class CLI implements InsertListener { configuration.setProjects(projects); configuration.save(); + + System.exit(errorCode); } /** -- 2.7.4