Files
SwiftShell/Sources/SwiftShell/String.swift
T
Kare Morstol fa70e419dd Enable building for iOS. Just the Stream part. So FileSmith can use it.
The rest cannot build on iOS because it uses Process.
Move the Stream files into its own directory.
2017-02-28 01:45:24 +01:00

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