/*
- * jSite -
- * Copyright (C) 2006 David Roden
+ * jSite - CLI.java - Copyright © 2006–2012 David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
}
- Configuration configuration = new Configuration(configFile);
- if (!configuration.createLockFile()) {
- outputWriter.println("Lock file found!");
- return;
+ ConfigurationLocator configurationLocator = new ConfigurationLocator();
+ if (configFile != null) {
+ configurationLocator.setCustomLocation(configFile);
}
+ Configuration configuration = new Configuration(configurationLocator, configurationLocator.findPreferredLocation());
projectInserter.addInsertListener(this);
projects = configuration.getProjects();
}
}
+ 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.");
}
configuration.setProjects(projects);
configuration.save();
+
+ System.exit(errorCode);
}
/**