diff --git a/ApprovalTests.Swift/Writers/ApprovalTextWriter.swift b/ApprovalTests.Swift/Writers/ApprovalTextWriter.swift index 05f38d0..72bb592 100644 --- a/ApprovalTests.Swift/Writers/ApprovalTextWriter.swift +++ b/ApprovalTests.Swift/Writers/ApprovalTextWriter.swift @@ -20,6 +20,8 @@ public struct ApprovalTextWriter: ApprovalWriter { public func writeReceivedFile(_ received: String) { let fileURL = URL(fileURLWithPath: received) do { + let parent = fileURL.deletingLastPathComponent() + print("Directory exists? \(FileManager.default.fileExists(atPath: parent.path))") try text.write(toFile: fileURL.path, atomically: true, encoding: .utf8) } catch { print("Error in \(#function) for received \"\(received)\": \(error)") diff --git a/iOSApprovalsWatcher.py b/iOSApprovalsWatcher.py index f4f4f00..ddbc6d9 100755 --- a/iOSApprovalsWatcher.py +++ b/iOSApprovalsWatcher.py @@ -30,6 +30,8 @@ def monitor(self): print(self) os.chmod(self.path, os.stat(self.path).st_mode | stat.S_IEXEC) subprocess.Popen(self.path) + time.sleep(0.5) + os.remove(self.path) def monitor_files(files):