jakeheis / Shout

SSH made easy in Swift
MIT License
360 stars 105 forks source link

no such module Shout #6

Closed taqios closed 6 years ago

taqios commented 6 years ago

mkdir ssh_shout cd ssh_shout swift package init --type executable Then I added .package(url: "https://github.com/jakeheis/Shout", from: "0.2.0") in the Package.swift Then I entered swift package fetch Then in Souces/ssh_shout/main.swift I entered import Shout, then swift build

and I got "no such module Shout".

What can be the problem? Thanks

jakeheis commented 6 years ago

Did you add Shout as a dependency of your main target?

let package = Package(
   ...
   dependencies: [
      .package(url: "https://github.com/jakeheis/Shout", from: "0.2.0")
   ],
   targets: [
      target(name: "MyTarget", dependencies: ["Shout"]),
   ] 
taqios commented 6 years ago

Thanks very much! That's been solved, but the main thing still not works.

Error message:

 Fatal error: Error raised at top level: Shout.LibSSH2Error.error(-16): file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.69.2/src/swift/stdlib/public/core/ErrorType.swift, line 187
Illegal instruction: 4

My main.swift:

import Shout

let session = try SSH.Session(host: "35.18.24.25")
try session.authenticate(username: "taqo4", privateKey: "~/dora", passphrase: "demo")

let (status, output) = try session.capture("pwd")

print("status: \(status)")
print("output: \(output)")

Thanks for the help!