Skip to content

Commit 5949378

Browse files
committed
- F ReporterThatCreatesAnApprovalScript for Linux
1 parent a65f352 commit 5949378

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

approvaltests/src/main/java/org/approvaltests/reporters/ReporterThatCreatesAnApprovalScript.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ private static void initializeFile() {
2727
}
2828

2929
private static void initializeLinux() {
30-
30+
scriptFile = new File(ApprovedFileLog.APPROVAL_TEMP_DIRECTORY + "/" + fileName + ".sh");
31+
FileUtils.createIfNeeded(scriptFile.getAbsolutePath());
32+
FileUtils.writeFile(scriptFile, "#!/bin/bash\n");
33+
scriptFile.setExecutable(true);
3134
}
3235

3336
private static void initializeWindows() {
@@ -39,7 +42,7 @@ private static void initializeWindows() {
3942
@Override
4043
public boolean report(String received, String approved) {
4144
String commandLine = ClipboardReporter.getCommandLine(received, approved);
42-
FileUtils.appendToFile(scriptFile, commandLine + "\r\n");
45+
FileUtils.appendToFile(scriptFile, commandLine + "\n");
4346
return true;
4447
}
4548
}

0 commit comments

Comments
 (0)