mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
[TAR] Rename the second argument of TarWriter.init to force
This is for consistency with TarContainer.create.
This commit is contained in:
@@ -13,7 +13,7 @@ public struct TarWriter {
|
||||
private var longLinkNameCounter: UInt
|
||||
private var localPaxHeaderCounter: UInt
|
||||
|
||||
public init(fileHandle: FileHandle, format: TarContainer.Format = .pax) {
|
||||
public init(fileHandle: FileHandle, force format: TarContainer.Format = .pax) {
|
||||
self.handle = fileHandle
|
||||
self.format = format
|
||||
self.longNameCounter = 0
|
||||
|
||||
@@ -210,7 +210,7 @@ class TarCommand: Command {
|
||||
let outputURL = URL(fileURLWithPath: self.input)
|
||||
try "".write(to: outputURL, atomically: true, encoding: .utf8)
|
||||
let handle = try FileHandle(forWritingTo: outputURL)
|
||||
var writer = TarWriter(fileHandle: handle, format: self.useFormat ?? .pax)
|
||||
var writer = TarWriter(fileHandle: handle, force: self.useFormat ?? .pax)
|
||||
try TarEntry.generateEntries(&writer, inputPath, verbose)
|
||||
try writer.finalize()
|
||||
try handle.closeHandleCompat()
|
||||
|
||||
@@ -31,7 +31,7 @@ class TarWriterTests: XCTestCase {
|
||||
let tempFileUrl = tempDir.appendingPathComponent(UUID().uuidString, isDirectory: false)
|
||||
try "".write(to: tempFileUrl, atomically: true, encoding: .utf8)
|
||||
let handle = try FileHandle(forWritingTo: tempFileUrl)
|
||||
var writer = TarWriter(fileHandle: handle, format: format)
|
||||
var writer = TarWriter(fileHandle: handle, force: format)
|
||||
for entry in entries {
|
||||
try writer.append(entry)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user