Skip to content

Commit 0558e92

Browse files
committed
Write files atomically
1 parent 45ef20f commit 0558e92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/swift-format/Run.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ func formatMain(
9696
buffer.flush()
9797
try localFileSystem.writeFileContents(
9898
AbsolutePath(assumingFileURL.path, relativeTo: AbsolutePath(cwd)),
99-
bytes: buffer.bytes
99+
bytes: buffer.bytes,
100+
atomically: true
100101
)
101102
} else {
102103
try formatter.format(source: source, assumingFileURL: assumingFileURL, to: &stdoutStream)

0 commit comments

Comments
 (0)