Skip to content

Commit

Permalink
DSL CLC v1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zapov committed May 20, 2017
1 parent e72389c commit 3b8d0a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CommandLineClient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212.jre6</version>
<version>42.1.1.jre6</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>1.11</version>
<version>1.16</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ private static void findDsls(final Context context) throws ExitException {
final List<File> dslFiles = dslPath.isFile()
? Collections.singletonList(dslPath)
: Utils.findFiles(context, dslPath, Arrays.asList(".dsl", ".ddd"));
final int pathLen = dslPath.getAbsolutePath().length();
final File basePath = dslPath.isFile() ? dslPath.getParentFile() : dslPath;
final int pathLen = basePath.getAbsolutePath().length();
for (final File file : dslFiles) {
if (!file.canRead()) {
context.error("Can't read DSL file: " + file.getName());
Expand All @@ -65,7 +66,7 @@ private static void findDsls(final Context context) throws ExitException {
if (content.isSuccess()) {
final String relativeName = file.getAbsolutePath().substring(pathLen);
if (dslMap.containsKey(relativeName)) {
context.warning("Duplicate DSL file specified: " + file.getAbsolutePath() + " from base path: " + part);
context.warning("Duplicate DSL file specified: " + file.getAbsolutePath() + " (" + relativeName + ") from base path: " + basePath.getAbsolutePath() + " (" + part + ")");
} else {
dslMap.put(relativeName, content.get());
allDslFiles.add(file);
Expand All @@ -92,10 +93,12 @@ public boolean check(final Context context) {
}
context.put(INSTANCE, "./dsl");
} else {
final File dslPath = new File(value);
if (!dslPath.exists()) {
context.error("Provided DSL path (" + value + ") does not exists. Please provide valid path to DSL files");
return false;
for (final String part : value.split(File.pathSeparator)) {
final File dslPath = new File(part).getAbsoluteFile();
if (!dslPath.exists()) {
context.error("Provided DSL path (" + part + ") does not exists. Please provide valid path to DSL files");
return false;
}
}
}
return true;
Expand Down

0 comments on commit 3b8d0a2

Please sign in to comment.