目录
目录README.md

Test results Latest release swift 5.1 shield swift 5.2 shield swift 5.3 shield swift dev shield Platforms: macOS, Linux

Runner

Some basic support for executing subprocesses, using Foundation.Process.

Usage:


let url = /* url to the executable */
let runner = Runner(for: url)

// execute and wait for results
let result = runner.sync(["some", "arguments"])
print(result.status)
print(result.stdout)
print(result.stderr)


// run in a different working directory
runner.cwd = /* url to the directory */
let _ = runner.sync(["blah"])

// transfer execution to the subprocess
runner.exec(url)

Path Lookup

Rather than supplying the path to the executable explicitly, you can instead supply just a name, and have it looked up using the $PATH environment variable.


let runner = Runner(command: "name")
关于
101.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号