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 许可证