Skip to content

Commit 397343f

Browse files
authored
Small cleanup to non-block based FileLock API (#462)
It doesn't seem like we should be giving access to the arbitrary initializer and instead vend `prepareLock` publicly.
1 parent 2d452ec commit 397343f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/TSCBasic/Lock.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public final class FileLock {
7777
/// Create an instance of FileLock at the path specified
7878
///
7979
/// Note: The parent directory path should be a valid directory.
80-
public init(at lockFile: AbsolutePath) {
80+
internal init(at lockFile: AbsolutePath) {
8181
self.lockFile = lockFile
8282
}
8383

@@ -191,7 +191,7 @@ public final class FileLock {
191191
return try await body()
192192
}
193193

194-
private static func prepareLock(
194+
public static func prepareLock(
195195
fileToLock: AbsolutePath,
196196
at lockFilesDirectory: AbsolutePath? = nil
197197
) throws -> FileLock {

Tests/TSCBasicTests/LockTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import XCTest
1212

13-
import TSCBasic
13+
@testable import TSCBasic
1414
import TSCTestSupport
1515

1616
class LockTests: XCTestCase {

0 commit comments

Comments
 (0)