-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use within a swift project #63
Comments
I created a new macOS app project, imported SwiftShell and the following code ran fine: let var1 = runAsync(bash: "echo hi").onCompletion {
command in self.label.stringValue = command.stdout.read()
}
do {
try var1.finish()
} catch {
print(error)
} Could you try a complete clean build of your project? If that doesn't work, is there a version of your project with this problem that you could share? |
I was able to fix my issue. |
Yes a new ticket would be nice. Also code examples, and could you also check if runAsync is started from the main thread? |
Sure. Thank you. |
How would I use this within a swift project?
Before your latest update, I setup SwiftShell like a standalone project, built it, then embedded the framework in my Xcode project. After updating SwiftShell, my project is now crashing with a message that it can't find a symbol in the framework.
dyld: Symbol not found: __T010SwiftShell12AsyncCommandC12onCompletionACyACcF
Referenced from: /Users/user/Desktop/myApp.app/Contents/MacOS/myApp
Expected in: /Users/user/Desktop/myApp.app/Contents/MacOS/../Frameworks/SwiftShell.framework/Versions/A/SwiftShell
It's possible I don't have something right with the code, but the only difference was the compiled SwiftShell.
I'm running this:
let var1 = runAsync(bash: myCmd).onCompletion {
command in
}
Grab the output by assigning var1.stdout.read() to a variable.
Then a do, try to call .finish() and catch any errors.
Thanks
The text was updated successfully, but these errors were encountered: