A nimble Swift Shell library.
Just add Swell to your package dependencies:
dependencies: [
// ...
.package(url: "https://github.com/marcelo-es/swell", from: "0.0.2"),
]And to your target's dependencies:
targets: [
.target(name: "MyTarget", dependencies: [
// ...
.product(name: "Swell", package: "swell"),
])
]Then execute shell commands and receive the standard output and error:
let (output, error) = try await Swell.run("echo", "Hello world")Or, if you are only interested in the standard output:
let output = try await Swell.run("echo", "Hello world").outputSwell looks for the executable in your $PATH for you.