An open API service indexing awesome lists of open source software.

https://github.com/cmst0us/rxshell

Launch bash shell in Reactive way, and also provide DSL Interface
https://github.com/cmst0us/rxshell

bash command-line linux process reactivex rxswift swift

Last synced: about 2 months ago
JSON representation

Launch bash shell in Reactive way, and also provide DSL Interface

Awesome Lists containing this project

README

        









RxShell: Use Swift Play with Shell in Reactive X Way






Key Features
How To Use
Related
License

## Key Features

- All write in **Swift**
- Run shell in Reactive X way
- DSL Interface for create shell command
- Custom Pipe
- Custom Enviroment
- [ ] Macro Support

## How To Use

```swift
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()
```

### Verbose
If you don't want RxShell Output shell command result, you can just set verbose to `false`

```
Shells(verbose: false) {
// Commands
}
```

## Related

> Thanks:
> - [ShellOut](https://github.com/JohnSundell/ShellOut)
> - [RxSwift](https://github.com/ReactiveX/RxSwift)

## License

MIT License

---