RxShell:以响应式编程方式使用 Swift 执行 Shell 命令

主要特性如何使用相关项目许可证

主要特性

如何使用

let enviroment = [
    "HELLOWORLD_STR": "Hello Bash"
]

Shells(verbose: true, environment: enviroment) {
    Commands {
        Shell.removeDirectoryIfExist("/tmp/tmp_file")
        Command("touch /tmp/tmp_file")
    }
    Command("echo $HELLOWORLD_STR > /tmp/tmp_file")
    Commands {
        "cat /tmp/tmp_file"
    }
}.action.subscribe().dispose()

详细输出

如果您不希望 RxShell 输出 Shell 命令的执行结果,您可以将 verbose 设置为 false

Shells(verbose: false) {
    // Commands
}

相关项目

感谢

许可证

MIT 许可证