Added access to environment variables, and new test script listallexecutablesinpath.
This commit is contained in:
@@ -73,6 +73,7 @@ public func open(path: String, mode: FileMode = .Read) -> File {
|
||||
return file!
|
||||
}
|
||||
|
||||
public let environment = NSProcessInfo.processInfo().environment as [String: String]
|
||||
public let standardinput = File.fileHandleWithStandardInput()
|
||||
public let standardoutput = File.fileHandleWithStandardOutput()
|
||||
public let standarderror = File.fileHandleWithStandardError()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
import SwiftShell
|
||||
|
||||
let directories = environment["PATH"]!.split(":")
|
||||
|
||||
for directory in directories {
|
||||
run("find \(directory) -type f -perm +ugo+x -print") |> standardoutput
|
||||
}
|
||||
Reference in New Issue
Block a user