Set an error code if project was not inserted successfully.
[jSite.git] / src / de / todesbaum / jsite / main / CLI.java
index d0f1a14..2c5edbd 100644 (file)
@@ -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);
        }
 
        /**
@@ -248,7 +252,7 @@ public class CLI implements InsertListener {
         * {@inheritDoc}
         */
        public void projectUploadFinished(Project project) {
-               outputWriter.println("Project \"" + project.getName() + "\" has ben uploaded, starting insert...");
+               outputWriter.println("Project \"" + project.getName() + "\" has been uploaded, starting insert...");
        }
 
        /**