-
Notifications
You must be signed in to change notification settings - Fork 1
/
bb.edn
179 lines (145 loc) · 5.68 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{:paths ["src"]
:min-bb-version "1.0.166"
:deps
{com.github.cldwalker/bb-dialog
{:git/sha "e10f2d8461b3de4c521c1fcf71552f38c47f33da"}}
:tasks
{:requires ([cldwalker.bb-clis.tasks.util :as tasks-util])
:enter (let [task-map (current-task)]
(def ^:dynamic *parsed-args*
(tasks-util/parse-options task-map))
(tasks-util/check-for-required-arguments *parsed-args* task-map))
help
{:doc "Print a task's help"
:usage "TASK"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:task (tasks/help *command-line-args*)}
repl
;; Couldn't just reference whole task as a map as `bb tasks` failed
{:doc "Pull up socket repl with #'tasks/result bound to result of given task and args"
:usage "TASK [& ARGS]"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:task (tasks/repl *command-line-args*)}
every-dir-shell
{:doc "Run shell command on every dir"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:usage "CMD [&ARGS]"
:options tasks/every-dir-shell-cli-options
:cli-options [:in-order true]
:task (tasks/every-dir-shell *parsed-args*)}
json=
{:doc "Check equality of given json files"
:usage "[& FILES]"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:task (prn (tasks/json= *command-line-args*))}
edn=
{:doc "Check equality of given edn files"
:usage "[& FILES]"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:task cldwalker.bb-clis.tasks/edn=}
data-diff
cldwalker.bb-clis.tasks/data-diff
brew-search-info
{:doc "Runs a brew info on all brew search results"
:usage "SEARCH"
:requires ([cldwalker.bb-clis.tasks :as tasks])
:task (tasks/brew-search-info *command-line-args*)}
update-gitlib
{:doc "Update git library sha in deps.edn"
:extra-deps {borkdude/rewrite-edn {:mvn/version "0.1.0"}}
:requires ([cldwalker.bb-clis.tasks.rewrite-edn :as rewrite-edn])
:usage "GITLIB SHA"
:task (rewrite-edn/update-gitlib *command-line-args*)}
rdf-data
{:doc "Fetches rdf contents of a url using rdf-dereference"
:usage "URL"
:requires ([cldwalker.bb-clis.tasks.rdf-data :as rdf-data]
[clojure.pprint :as pprint])
:options rdf-data/rdf-data-cli-options
:task (pprint/pprint (rdf-data/rdf-data *command-line-args* (:options *parsed-args*)))}
clone
{:doc "Clone a git url"
:usage "URL"
:extra-deps {org.clojure/tools.gitlibs {:mvn/version "2.4.172"}}
:requires ([cldwalker.bb-clis.tasks.git :as git])
:options git/clone-cli-options
:task (git/clone *parsed-args*)}
var-sizes
{:doc "Print vars with largest LOCs"
:usage "[& SOURCE-PATHS]"
:requires ([cldwalker.bb-clis.tasks.clj-kondo :as clj-kondo])
:task (prn (clj-kondo/var-sizes *command-line-args*))}
var-meta
{:doc "Prints var metadata for source-paths. Defaults to src/ for source-paths"
:usage "[& SOURCE-PATHS]"
:requires ([cldwalker.bb-clis.tasks.clj-kondo :as clj-kondo])
:task (prn (clj-kondo/var-meta *command-line-args*))}
ns-meta
{:doc "Prints ns metadata for source-paths. Defaults to src/ for source-paths"
:usage "[& SOURCE-PATHS]"
:requires ([cldwalker.bb-clis.tasks.clj-kondo :as clj-kondo])
:task (prn (clj-kondo/ns-meta *command-line-args*))}
;; From @borkdude
http-server
{:extra-deps {babashka/http-server
{:git/url "https://github.com/babashka/http-server"
:git/sha "d1f01b47492dec245f3f6d297849ee038243ee86"}}
:doc "Run a basic http server"
:task babashka.http-server/-main}
;; From https://blog.michielborkent.nl/babashka-test-runner.html
test
{:extra-paths ["test"
;; This is specific to bb-clis but this task can still be
;; used for any bb repo
"test/resources"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:task (exec 'cognitect.test-runner.api/test)
:exec-args {:dirs ["test"]}
:doc "Run tests with cognitect test runner"
:org.babashka/cli {:coerce {:nses [:symbol]
:vars [:symbol]}}}
ns-in-dir
{:extra-deps {org.clojure/tools.namespace {:git/url "https://github.com/babashka/tools.namespace"
:git/sha "3625153ee66dfcec2ba600851b5b2cbdab8fae6c"}}
:requires ([clojure.tools.namespace.find :as find]
[babashka.fs :as fs])
:doc "Prints namespaces in dir"
:usage "DIR"
:task (prn (apply find/find-namespaces-in-dir (map fs/file *command-line-args*)))}
var-sexp
{:requires ([cldwalker.bb-clis.tasks.rewrite-clj :as rewrite-clj])
:doc "For given file, returns var sexp which is usually its value"
:usage "VAR FILE"
:task (prn (rewrite-clj/var-sexp *command-line-args*))}
do-sh
cldwalker.bb-clis.tasks/do-sh
logseq:empty-files
cldwalker.bb-clis.tasks.logseq/empty-files
logseq:pages
cldwalker.bb-clis.tasks.logseq/pages
logseq:urls
cldwalker.bb-clis.tasks.logseq/urls
logseq:copy-entities
cldwalker.bb-clis.tasks.logseq/copy-entities
logseq:copy-files
cldwalker.bb-clis.tasks.logseq/copy-files
logseq:copy-common-pages
cldwalker.bb-clis.tasks.logseq/copy-common-pages
logseq:validate-common-pages
cldwalker.bb-clis.tasks.logseq/validate-common-pages
logseq:list-common-pages
cldwalker.bb-clis.tasks.logseq/list-common-pages
dev:rdf-equal
cldwalker.bb-clis.tasks.rdf/rdf-equal
dev:triples-count
cldwalker.bb-clis.tasks.rdf/triples-count
wc-l
cldwalker.bb-clis.tasks/wc-l
grep-result-frequencies
cldwalker.bb-clis.tasks/grep-result-frequencies
specter:example
{:extra-deps {com.rpl/specter {:mvn/version "1.1.4"}}
:task cldwalker.bb-clis.tasks.specter/example}
gh:checkout-pr-branch
cldwalker.bb-clis.tasks.github/checkout-pr-branch}}