Skip to content

Commit 44fe6f0

Browse files
committed
[DXP-1821] Fix Windows newlines
1 parent 3db66a8 commit 44fe6f0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

core/src/main/java/dev/streamx/cli/ParameterExceptionHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ public int handleParseException(ParameterException ex, String[] args) {
2828
writer.println(cmd.getHelp().fullSynopsis());
2929

3030
CommandSpec spec = cmd.getCommandSpec();
31-
writer.printf("Try '%s --help' for more information.%n", spec.qualifiedName());
31+
writer.printf("Try '%s --help' for more information.", spec.qualifiedName());
32+
writer.println();
3233

3334
if (cmd.getExitCodeExceptionMapper() != null) {
3435
return cmd.getExitCodeExceptionMapper().getExitCode(ex);
3536
}
3637
return spec.exitCodeOnInvalidInput();
3738
}
38-
}
39+
}

core/src/main/java/dev/streamx/cli/command/ingestion/batch/BatchCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ protected void doRun(StreamxClient client) throws StreamxClientException {
8989
} catch (FileIngestionException e) {
9090
throw new RuntimeException(
9191
ExceptionUtils.appendLogSuggestion(
92-
"Error performing batch publication while processing '" + e.getPath() + "' file.\n"
92+
"Error performing batch publication while processing '"
93+
+ FileUtils.toString(e.getPath()) + "' file.\n"
9394
+ "\n"
9495
+ "Details:\n"
9596
+ e.getCause().getMessage()), e);
@@ -140,7 +141,7 @@ private void updateCommandState(Path file, EventSourceDescriptor eventSource) {
140141
String key = substitutor.substitute(variables, eventSource.getKey());
141142
JsonNode message = executeHandlingException(
142143
() -> payloadResolver.createPayload(eventSource, variables),
143-
() -> "Could not resolve payload for file '" + file + "'"
144+
() -> "Could not resolve payload for file '" + FileUtils.toString(file) + "'"
144145
);
145146

146147
Map<String, String> properties = createProperties(eventSource, variables);

core/src/test/java/dev/streamx/cli/command/cloud/ProjectUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public static Path getProjectPath() {
2626
public static String getResource(String resourceName) throws IOException {
2727
try (InputStream is = ServiceMeshResolverTest.class.getResourceAsStream(
2828
PROJECT_PATH + resourceName)) {
29-
return new String(is.readAllBytes(), StandardCharsets.UTF_8);
29+
return new String(is.readAllBytes(), StandardCharsets.UTF_8)
30+
.replace("\r\n", "\n");
3031
}
3132
}
3233
}

0 commit comments

Comments
 (0)