Forrest 特点
import Forrest
let forrest = Forrest()
// Get Current Directory
let pwd = forrest.run("pwd").stdout
// Piped Commands
let swiftFiles = forrest.run("ls -la | grep swift").stdout
第一个示例是一个程序,该程序将列出您启动目录中的 Swift 文件。要运行此程序
git clone https://github.com/Gruppio/Run-Forrest-Run.git
cd Run-Forrest-Run/Examples/ListSwiftFiles
swift build
.build/debug/ListSwiftFiles
您可以使用 SPM(Swift 包管理器)安装 Commander
Forrest 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod "Forrest"
Forrest 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。