Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phatblat/shellexec
🐚 Gradle plugin with a simpler Exec task
https://github.com/phatblat/shellexec
bash exec gradle kotlin shell
Last synced: about 2 months ago
JSON representation
🐚 Gradle plugin with a simpler Exec task
- Host: GitHub
- URL: https://github.com/phatblat/shellexec
- Owner: phatblat
- License: mit
- Created: 2017-10-19T23:23:02.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-05-20T14:23:35.000Z (7 months ago)
- Last Synced: 2024-10-14T18:29:30.473Z (2 months ago)
- Topics: bash, exec, gradle, kotlin, shell
- Language: Kotlin
- Homepage:
- Size: 527 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ShellExec
A simpler extension point than [`Exec`](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html) for ad-hoc Gradle tasks that run shell commands.
## Features
- Specify entire `command` line in one string (instead of `List`).
- Append/prepend to the current `PATH`.
- Execute a `command | pipe` or `conditional && command || chain`.
- Easy access to `stdout` and `stderr`.:warning: Not compatible with `Exec` tasks yet (see [#11](https://github.com/phatblat/ShellExec/issues/11)), but the current API is very similar.
## Example `build.gradle.kts`
```kts
import at.phatbl.shellexec.ShellExecbuildscript {
repositories.gradlePluginPortal()
dependencies.classpath("at.phatbl:shellexec:+")
}val lolBoxFortune by registering(ShellExec::class) {
command = "fortune | boxes --design parchment --no-color | lolcat --force"
}
```> Note that the `boxes` and `lolcat` tools need to be installed for the above `lolBoxFortune` to work.
### Task Output
```text
> Task :lolBoxFortune
____________
/\ \
\_| Ship it. |
| |
| _______|_
\_/_________/BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
```## License
This repo is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for rights and limitations.