File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ increments version by git log message contexts.
2323
2424[ semver workflow of this repository] ( https://github.com/rinx/gitwerk/blob/master/.github/workflows/semver.yml ) is an example of this subcommand.
2525
26- ```
26+ ``` bash
2727# # when the latest tag is v0.0.1
2828$ git commit -m " [patch] increment patch version"
2929# # the commit comment contains "[patch]"
@@ -64,7 +64,7 @@ $ gitwerk semver-auto
6464
6565prints incremented version.
6666
67- ```
67+ ``` bash
6868# # when the latest tag is v0.0.1
6969
7070$ gitwerk semver patch
8181
8282gitwerk supports to run user-defined scripts written in clojure (powered by [ borkdude/sci] ( https://github.com/borkdude/sci ) ).
8383
84- ```
84+ ``` bash
8585# # can read stdin
8686$ echo ' (semver ctx ["patch"])' | gitwerk sci
8787v0.0.2
@@ -107,6 +107,12 @@ Version not updated
107107$ git commit --allow-empty -m " [patch] version updated"
108108$ gitwerk sci examples/example2.clj
109109Version updated: v0.0.3 -> v0.0.4
110+
111+ # # http get/post using clj-http-lite.client
112+ $ echo ' (-> (http/get "https://api.github.com/repos/rinx/gitwerk/issues") pprint)' | gitwerk sci
113+
114+ # # parse json and convert to clj map
115+ $ echo ' (-> (http/get "https://api.github.com/repos/rinx/gitwerk/issues") :body (json/read-value) pprint)' | gitwerk sci
110116```
111117
112118## License
Original file line number Diff line number Diff line change 22 (:require
33 [clojure.spec.alpha :as spec]
44 [clojure.pprint :as pprint]
5+ [clojure.edn :as edn]
56 [sci.core :as sci]
6- [gitwerk.internal.io :as internal.io]))
7+ [clj-http.lite.client :as http]
8+ [gitwerk.internal.io :as internal.io]
9+ [gitwerk.internal.json :as json]))
710
811(def clj-primitives
912 {'println println
10- 'pprint pprint/pprint})
13+ 'pprint pprint/pprint
14+ 'json/read-value json/read-value
15+ 'edn/read-string edn/read-string
16+ 'env #(or (System/getenv %) " " )
17+ 'http/get http/get
18+ 'http/post http/post})
1119
1220(defn run-fn [sci-opts]
1321 (fn [ctx args]
You can’t perform that action at this time.
0 commit comments