diff --git a/approvaltests/src/main/java/org/approvaltests/reporters/ReporterThatCreatesAnApprovalScript.java b/approvaltests/src/main/java/org/approvaltests/reporters/ReporterThatCreatesAnApprovalScript.java index f8244d6b..4c31b746 100644 --- a/approvaltests/src/main/java/org/approvaltests/reporters/ReporterThatCreatesAnApprovalScript.java +++ b/approvaltests/src/main/java/org/approvaltests/reporters/ReporterThatCreatesAnApprovalScript.java @@ -27,7 +27,10 @@ private static void initializeFile() { } private static void initializeLinux() { - + scriptFile = new File(ApprovedFileLog.APPROVAL_TEMP_DIRECTORY + "/" + fileName + ".sh"); + FileUtils.createIfNeeded(scriptFile.getAbsolutePath()); + FileUtils.writeFile(scriptFile, "#!/bin/bash\n"); + scriptFile.setExecutable(true); } private static void initializeWindows() { @@ -39,7 +42,7 @@ private static void initializeWindows() { @Override public boolean report(String received, String approved) { String commandLine = ClipboardReporter.getCommandLine(received, approved); - FileUtils.appendToFile(scriptFile, commandLine + "\r\n"); + FileUtils.appendToFile(scriptFile, commandLine + "\n"); return true; } }