Skip to content

Commit

Permalink
Small cleanup to non-block based FileLock API (#462)
Browse files Browse the repository at this point in the history
It doesn't seem like we should be giving access to the arbitrary initializer and instead vend `prepareLock` publicly.
  • Loading branch information
neonichu authored Jan 30, 2024
1 parent 2d452ec commit 397343f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/TSCBasic/Lock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public final class FileLock {
/// Create an instance of FileLock at the path specified
///
/// Note: The parent directory path should be a valid directory.
public init(at lockFile: AbsolutePath) {
internal init(at lockFile: AbsolutePath) {
self.lockFile = lockFile
}

Expand Down Expand Up @@ -191,7 +191,7 @@ public final class FileLock {
return try await body()
}

private static func prepareLock(
public static func prepareLock(
fileToLock: AbsolutePath,
at lockFilesDirectory: AbsolutePath? = nil
) throws -> FileLock {
Expand Down
2 changes: 1 addition & 1 deletion Tests/TSCBasicTests/LockTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import XCTest

import TSCBasic
@testable import TSCBasic
import TSCTestSupport

class LockTests: XCTestCase {
Expand Down

0 comments on commit 397343f

Please sign in to comment.