SwiftProcessManager

main

Swift package to manage running a binary using Process().
calmdocs/SwiftProcessManager

SwiftProcessManager

Swift package to manage running a binary using Process().

import SwiftProcessManager

let processManager = ProcessManager()
await self.processProvider.RunProces(
    url: Bundle.main.url(forResource: "bundled-binary", withExtension: nil),
    withRetry: true,                    // Retry running the binary when it exits.
    standardOutput: { output in
        print(output)
    },
    taskExitNotification: { err in
        if err != nil {
          processManager.cancel()       // Optionally stop retrying running the binary if the binary returns an error.
          print(err)
        }
    }
)

Description

  • Swift Tools 5.8.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Oct 21 2024 07:07:53 GMT-0900 (Hawaii-Aleutian Daylight Time)