Skip to content

Commit

Permalink
added behavior for when value specified in sourceRootFolder is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
mastern2k3 committed Mar 14, 2016
1 parent 022219e commit 24240f0
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,20 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
});
}

private File zipProjectFolder(String directory, DriverPublisherSettings settings) throws IOException {
private File zipProjectFolder(String directory, DriverPublisherSettings settings) throws Exception {

Map<String, ByteBuffer> extras = new HashMap<>();

if (settings.sourceRootFolder != null && !settings.sourceRootFolder.isEmpty()) {

Path sourceFolder = Paths.get(directory, settings.sourceRootFolder);

if (!Files.exists(sourceFolder))
throw new Exception(String.format("Couldn't find specified source folder \"%s\" as in \"%s\"", settings.sourceRootFolder, sourceFolder.toString()));

directory = sourceFolder.toString();
}

if (settings.runFromLocalProject) {

String debugSettingsFileContent = String.format(DebugSettingsFormatString, directory, Boolean.toString(settings.waitForDebugger));
Expand All @@ -126,9 +136,6 @@ private File zipProjectFolder(String directory, DriverPublisherSettings settings

Path deploymentFilePath = Paths.get(directory, "deployment", settings.driverUniqueName + ".zip");

if (settings.sourceRootFolder != null && !settings.sourceRootFolder.isEmpty())
directory = Paths.get(directory, settings.sourceRootFolder).toString();

zipHelper.zipDir(directory, deploymentFilePath.toString());

return deploymentFilePath.toFile();
Expand Down

0 comments on commit 24240f0

Please sign in to comment.