SwiftShell icon indicating copy to clipboard operation
SwiftShell copied to clipboard

onStringOutput returning nothing.

Open ghost opened this issue 5 years ago • 0 comments

Hi! I'm new to this, so I might be making a user error, but I'm not sure where to ask.

I'm playing around with this library right now and I'm trying to start simple by downloading a file using cURL. However, when I call onStringOutput, I get nothing. I'm probably using this incorrectly, but hopefully, you guys can help. It looks like a really great library and a huge upgrade from what I was using (as long as this async stuff works.)

let asyncCommand = runAsync(bash: "curl -L -o ~/.patched-sur/Download.html https://support.apple.com/en-us/HT211983").onCompletion { command in
    at = 0
}
asyncCommand.stdout.onStringOutput {
    print($0)
}
do {
    try asyncCommand.finish()
} catch {
    print("SOMETHING WENT WRONG")
}

ghost avatar Dec 01 '20 04:12 ghost