The rest cannot build on iOS because it uses Process. Move the Stream files into its own directory.
26 lines
525 B
Swift
26 lines
525 B
Swift
/*
|
|
* Released under the MIT License (MIT), http://opensource.org/licenses/MIT
|
|
*
|
|
* Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com)
|
|
*
|
|
*/
|
|
|
|
#if !(os(iOS) || os(tvOS) || os(watchOS))
|
|
|
|
import Foundation
|
|
|
|
/** Let Strings run commands using itself as stdin. */
|
|
extension String: ShellRunnable {
|
|
public var shellcontext: ShellContextType {
|
|
var context = ShellContext(main)
|
|
let (writer,reader) = streams()
|
|
|
|
writer.write(self)
|
|
writer.close()
|
|
context.stdin = reader
|
|
return context
|
|
}
|
|
}
|
|
|
|
#endif
|