Skip to content

Commit c7ad9c2

Browse files
committed
docs
1 parent c6252e8 commit c7ad9c2

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Vero is experimental and not finished. At ekspono we use Vero for all our "scrip
1111

1212
## Setup
1313

14-
At the moment Vero is a bit complicated to set up. This is fine for us since we have a monorepo structure and a containerized dev environment where Vero is provided.
14+
At the moment Vero is a bit complicated to set up. This is fine for us since we have a monorepo structure and a containerized dev environment where Vero is provided. Vero currently has a hard dependency on git and needs to be executed inside a git repository.
1515

1616
## Example
1717

@@ -24,14 +24,13 @@ Here's an annotated example of a Vero script that tries to convey the most impor
2424

2525
**example.clj**
2626

27-
(`bin/vero` is a wrapper script that is used to fix argument passing on linux and MacOS when calling the Babashka binary)
27+
(`../bin/vero` is a wrapper script that is used to fix argument passing on linux and MacOS when calling the Babashka binary)
2828

2929
```Clojure
30-
#!bin/vero
31-
3230
#!../bin/vero
3331

34-
(require '[ekspono.vero :as vero])
32+
(require '[ekspono.vero :as vero :refer [run <-run]]
33+
'[ekspono.vero.errors :refer [fatal!]])
3534

3635
(defn say-hello
3736
[]
@@ -42,7 +41,14 @@ Here's an annotated example of a Vero script that tries to convey the most impor
4241
(println from-opt)
4342
(println from-env-var)
4443
(println from-cmd)
45-
(println from-edn-file)))
44+
(println from-edn-file))
45+
46+
;; Vero has utility functions for calling other binaries.
47+
(let [result (<-run ["echo" "hello"])]
48+
(println "Run commands and capture the exit status and output:" result))
49+
50+
;; Run commands without capturing the output
51+
(run ["echo" "some text"]))
4652

4753
;; Argument parsing is done by docopt
4854
(def usage "example.clj
@@ -70,7 +76,6 @@ Options:
7076
(fn [opts]
7177
(cond
7278
(:say-hello opts) (say-hello))))
73-
7479
```
7580

7681
Execute with:

examples/example.clj

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!../bin/vero
22

3-
(require '[ekspono.vero :as vero])
3+
(require '[ekspono.vero :as vero :refer [run <-run]]
4+
'[ekspono.vero.errors :refer [fatal!]])
45

56
(defn say-hello
67
[]
@@ -11,7 +12,14 @@
1112
(println from-opt)
1213
(println from-env-var)
1314
(println from-cmd)
14-
(println from-edn-file)))
15+
(println from-edn-file))
16+
17+
;; Vero has utility functions for calling other binaries.
18+
(let [result (<-run ["echo" "hello"])]
19+
(println "Run commands and capture the exit status and output:" result))
20+
21+
;; Run commands without capturing the output
22+
(run ["echo" "some text"]))
1523

1624
;; Argument parsing is done by docopt
1725
(def usage "example.clj

0 commit comments

Comments
 (0)