https://github.com/degree9/boot-exec
Boot-clj external process execution using Apache Commons Exec
https://github.com/degree9/boot-exec
boot-clj
Last synced: 5 months ago
JSON representation
Boot-clj external process execution using Apache Commons Exec
- Host: GitHub
- URL: https://github.com/degree9/boot-exec
- Owner: degree9
- License: mit
- Created: 2016-06-30T20:04:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T03:02:45.000Z (about 6 years ago)
- Last Synced: 2024-04-09T16:57:44.539Z (about 1 year ago)
- Topics: boot-clj
- Language: Clojure
- Size: 109 KB
- Stars: 9
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://clojars.org/degree9/boot-exec)
[](https://versions.deps.co/degree9/boot-exec)
[](https://versions.deps.co/degree9/boot-exec)
[](https://medium.com/degree9/boot-boot-exec-e1453826b732)
[![Slack][slack]][d9-slack]Boot-clj external process execution using Apache Commons Exec
---
![]()
boot-exec is developed and maintained by Degree9---
(Sub)Process Execution for [boot-clj][1].
* Provides `exec` task for process execution
* Provides `properties` task for property/config file generation.> The following outlines basic usage of the task, extensive testing has not been done.
> Please submit issues and pull requests!## Usage ##
Add `boot-exec` to your `build.boot` dependencies and `require` the namespace:
```clj
(set-env! :dependencies '[[degree9/boot-exec "X.Y.Z" :scope "test"]])
(require '[degree9.boot-exec :refer :all])
```Execute an external build tool:
```bash
boot exec -p bower -a "install"
```Create a properties file:
```bash
boot properties -f bower.json -d -c
```Use in a wrapper task:
```clojure
(boot/deftask bower
"boot-clj wrapper for bower"
[...]
(let [...]
(comp
(exec/properties :contents bwrjson :directory tmp-path :file "bower.json")
(exec/properties :contents bwrrc :directory tmp-path :file ".bowerrc")
(exec/exec :process "bower" :arguments ["install" "--allow-root"] :directory tmp-path :local "node_modules/bower/bin"))))
```## Task Options ##
The `exec` task exposes options for specifying where to look for an executable and where to execute once it is found.
```clojure
p process VAL str "Name of process to execute."
a arguments VAL [str] "A list of arguments to pass to the executable."
k cache-key VAL kw "Optional cache key for when exec is used for various filesets."
d directory VAL str "Optional target directory to execute the process within."
g global VAL str "Optional global path to search for the executable."
l local VAL str "Optional local path to search for the executable."```
```The `:cache-key` and `directory` options are mutually exclusive, the task first checks for a cache-key if found this is the location where the process will execute. If a directory is provided instead the directory location will be used for execution. If neither are provided the task will generate and use a temporary directory.
---
![]()
Support this and other open-source projects on Patreon!---
[1]: https://github.com/boot-clj/boot
[2]: https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm
[slack]: https://img.shields.io/badge/clojurians-degree9-%23e01563.svg?logo=slack
[d9-slack]: https://clojurians.slack.com/channels/degree9/