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
- Host: GitHub
- URL: https://github.com/cmst0us/rxshell
- Owner: CmST0us
- License: mit
- Created: 2023-11-26T03:47:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T09:57:58.000Z (over 1 year ago)
- Last Synced: 2024-04-29T07:42:57.524Z (about 1 year ago)
- Topics: bash, command-line, linux, process, reactivex, rxswift, swift
- Language: Swift
- Homepage:
- Size: 233 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
---