Swiftpack.co - elegantchaos/Runner as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by elegantchaos.
elegantchaos/Runner v1.3.2
Swift helper for launching subprocesses and capturing their output.
⭐️ 2
🕓 12 weeks ago
macOS
.package(url: "https://github.com/elegantchaos/Runner.git", from: "v1.3.2")

Test results Latest release swift 5.1 shield swift 5.2 shield swift 5.3 shield swift dev shield Platforms: macOS, Linux

Runner

Some basic support for executing subprocesses, using Foundation.Process.

Usage:


let url = /* url to the executable */
let runner = Runner(for: url)

// execute and wait for results
let result = runner.sync(["some", "arguments"])
print(result.status)
print(result.stdout)
print(result.stderr)


// run in a different working directory
runner.cwd = /* url to the directory */
let _ = runner.sync(["blah"])

// transfer execution to the subprocess
runner.exec(url)

Path Lookup

Rather than supplying the path to the executable explicitly, you can instead supply just a name, and have it looked up using the $PATH environment variable.


let runner = Runner(command: "name")

GitHub

link
Stars: 2
Last commit: 11 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1.3.1
1 year ago

Perform buffer operations on a serial queue to prevent race conditions. Don't run tests on iOS.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics