Skip to content

Commit

Permalink
Update package
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanot committed Dec 2, 2024
1 parent 925ca4b commit fa043d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import Darwin
import Foundation
import Swift

public class _StandardOutputRewriter {
public class _StandardOutputRewriter: @unchecked Sendable {
private var originalSTDOUTDescriptor: Int32 = -1
private var originalSTDERRDescriptor: Int32 = -1
private let stdoutPipe: Pipe = Pipe()
private let stderrPipe: Pipe = Pipe()
private let modifyLine: (String) -> String?
private let modifyLine: @Sendable (String) -> String?

private var stdoutBuffer = Data()
private var stderrBuffer = Data()
Expand All @@ -21,7 +21,9 @@ public class _StandardOutputRewriter {
private var stopContinuation: CheckedContinuation<Void, Never>?
private let hasRunLoop: Bool

public init(modifyLine: @escaping (String) -> String?) {
public init(
modifyLine: @escaping @Sendable (String) -> String?
) {
self.modifyLine = modifyLine
self.hasRunLoop = _StandardOutputRewriter.checkRunLoopAvailability()

Expand Down
8 changes: 8 additions & 0 deletions Sources/ShellScripting/Intramodular/Process+sh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public func shq(
._runAsynchronouslyRedirectingAllOutput(to: sink)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
_ cmd: String,
Expand All @@ -184,6 +185,7 @@ public func sh(
return try shq(cmd, environment: environment, workingDirectory: workingDirectory)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
_ cmd: String,
Expand All @@ -195,6 +197,7 @@ public func sh(
return try await shq(cmd, environment: environment, workingDirectory: workingDirectory)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
command: String,
Expand All @@ -208,6 +211,7 @@ public func sh(
)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
_ sink: Process.StandardOutputSink,
Expand All @@ -223,6 +227,7 @@ public func sh(
)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
_ cmd: String,
Expand All @@ -238,6 +243,7 @@ public func sh(
)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh<D: Decodable>(
_ type: D.Type,
Expand All @@ -257,6 +263,7 @@ public func sh<D: Decodable>(
)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh<D: Decodable>(
_ type: D.Type,
Expand All @@ -276,6 +283,7 @@ public func sh<D: Decodable>(
)
}

@available(*, deprecated)
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func sh(
_ sink: Process.StandardOutputSink,
Expand Down

0 comments on commit fa043d6

Please sign in to comment.