You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/configuration/command.md
+84-84
Original file line number
Diff line number
Diff line change
@@ -4,84 +4,11 @@ afx's goal is to finally support to install packages as `command`, `plugin` or b
4
4
5
5
## Parameters
6
6
7
-
### build.steps
8
-
9
-
Type | Required
10
-
---|---
11
-
list | yes (when using `build`)
12
-
13
-
`build.steps` can be specified build commands to build a package.
14
-
15
-
=== "Case 1"
16
-
17
-
```yaml hl_lines="7 8 9 10" title="Using sudo"
18
-
github:
19
-
- name: jhawthorn/fzy
20
-
description: A better fuzzy finder
21
-
owner: jhawthorn
22
-
repo: fzy
23
-
command:
24
-
build:
25
-
steps:
26
-
- make
27
-
- sudo make install
28
-
```
29
-
30
-
In this case, build steps has `sudo` command but it can be run as expected. But in advance you will be asked to input sudo password.
31
-
32
-
=== "Case 2"
33
-
34
-
```yaml hl_lines="7 8 9" title="Using go build"
35
-
github:
36
-
- name: iovisor/kubectl-trace
37
-
description: Schedule bpftrace programs on your kubernetes cluster using the kubectl
38
-
owner: iovisor
39
-
repo: kubectl-trace
40
-
command:
41
-
build:
42
-
steps:
43
-
- go build -o kubectl-trace cmd/kubectl-trace/root.go
44
-
link:
45
-
- from: kubectl-trace
46
-
to: kubectl-trace
47
-
```
48
-
49
-
In this case, build steps run `go build` command because this package does not provide GitHub releases on its own page. So we need to build by ourselves. afx build feature is very helpful in such a case.
50
-
51
-
`go build` command creates `red` command to current working directory so you need to have `link` section to install the built binary to your PATH.
52
-
53
-
### build.env
54
-
55
-
Type | Required
56
-
---|---
57
-
map | no
58
-
59
-
`build.env` can be specified environemnt variables used when running build a package.
60
-
61
-
=== "Case 1"
62
-
63
-
```yaml hl_lines="11 12"
64
-
github:
65
-
- name: jhawthorn/fzy
66
-
description: A better fuzzy finder
67
-
owner: jhawthorn
68
-
repo: fzy
69
-
command:
70
-
build:
71
-
steps:
72
-
- make
73
-
- sudo make install
74
-
env:
75
-
VERSION: 1.0
76
-
```
77
-
78
-
In this case, VERSION is specified to change version used in build steps.
79
-
80
7
### link.from
81
8
82
-
Type | Required
9
+
Type | Default
83
10
---|---
84
-
string | yes (when using `link`)
11
+
string | (required)
85
12
86
13
`link.from` can be specified where to install from.
87
14
@@ -121,11 +48,11 @@ string | yes (when using `link`)
121
48
122
49
### link.to
123
50
124
-
Type | Required
51
+
Type | Default
125
52
---|---
126
-
string | no
53
+
string | `$AFX_COMMAND_PATH/(command-name)`
127
54
128
-
`link.to` can be specified where to install to.
55
+
`link.to` can be specified where to install to. If omitted, the command will be installed to `$AFX_COMMAND_PATH`.
129
56
130
57
=== "Case 1"
131
58
@@ -183,9 +110,9 @@ string | no
183
110
184
111
### env
185
112
186
-
Type | Required
113
+
Type | Default
187
114
---|---
188
-
map | no
115
+
map | `{}`
189
116
190
117
`env` allows you to set environment variables. By having this section in same YAML file of package declaration, you can manage it with same file. When we don't have afx, we should have environment variables in shell config (e.g. zshrc) even if not installed it yet or failed to install it. But thanks to afx, afx users can keep it with same files and enable it only while a package is installed.
191
118
@@ -221,9 +148,9 @@ map | no
221
148
222
149
### alias
223
150
224
-
Type | Required
151
+
Type | Default
225
152
---|---
226
-
map | no
153
+
map | `{}`
227
154
228
155
`alias` allows you to set command aliases.
229
156
@@ -288,11 +215,84 @@ map | no
288
215
- from: '**/bat'
289
216
```
290
217
218
+
### build.steps
219
+
220
+
Type | Default
221
+
---|---
222
+
list | `[]`
223
+
224
+
`build.steps` can be specified build commands to build a package.
225
+
226
+
=== "Case 1"
227
+
228
+
```yaml hl_lines="7 8 9 10" title="Using sudo"
229
+
github:
230
+
- name: jhawthorn/fzy
231
+
description: A better fuzzy finder
232
+
owner: jhawthorn
233
+
repo: fzy
234
+
command:
235
+
build:
236
+
steps:
237
+
- make
238
+
- sudo make install
239
+
```
240
+
241
+
In this case, build steps has `sudo` command but it can be run as expected. But in advance you will be asked to input sudo password.
242
+
243
+
=== "Case 2"
244
+
245
+
```yaml hl_lines="7 8 9" title="Using go build"
246
+
github:
247
+
- name: iovisor/kubectl-trace
248
+
description: Schedule bpftrace programs on your kubernetes cluster using the kubectl
249
+
owner: iovisor
250
+
repo: kubectl-trace
251
+
command:
252
+
build:
253
+
steps:
254
+
- go build -o kubectl-trace cmd/kubectl-trace/root.go
255
+
link:
256
+
- from: kubectl-trace
257
+
to: kubectl-trace
258
+
```
259
+
260
+
In this case, build steps run `go build` command because this package does not provide GitHub releases on its own page. So we need to build by ourselves. afx build feature is very helpful in such a case.
261
+
262
+
`go build` command creates `red` command to current working directory so you need to have `link` section to install the built binary to your PATH.
263
+
264
+
### build.env
265
+
266
+
Type | Required
267
+
---|---
268
+
map | `{}`
269
+
270
+
`build.env` can be specified environemnt variables used when running build a package.
271
+
272
+
=== "Case 1"
273
+
274
+
```yaml hl_lines="11 12"
275
+
github:
276
+
- name: jhawthorn/fzy
277
+
description: A better fuzzy finder
278
+
owner: jhawthorn
279
+
repo: fzy
280
+
command:
281
+
build:
282
+
steps:
283
+
- make
284
+
- sudo make install
285
+
env:
286
+
VERSION: 1.0
287
+
```
288
+
289
+
In this case, VERSION is specified to change version used in build steps.
290
+
291
291
### snippet
292
292
293
293
Type | Required
294
294
---|---
295
-
string | no
295
+
string | `""`
296
296
297
297
`snippet` allows you to specify the command which are runned when starting new shell.
298
298
@@ -318,7 +318,7 @@ string | no
318
318
319
319
Type | Required
320
320
---|---
321
-
string | no
321
+
string | `""`
322
322
323
323
`if` allows you to specify the condition to load packages. If it returns true, then the command will be linked. But if it returns false, the command will not be linked.
Copy file name to clipboardexpand all lines: docs/configuration/plugin.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ afx's goal is to finally support to install packages as `command`, `plugin` or b
6
6
7
7
### sources
8
8
9
-
Type | Required
9
+
Type | Default
10
10
---|---
11
-
list | yes
11
+
list | (required)
12
12
13
13
`sources` allows you to select what to load files when starting shell.
14
14
@@ -56,9 +56,9 @@ list | yes
56
56
57
57
### env
58
58
59
-
Type | Required
59
+
Type | Default
60
60
---|---
61
-
list | no
61
+
map | `{}`
62
62
63
63
`env` allows you to set environment variables. By having this section in same YAML file of package declaration, you can manage it with same file. When we don't have afx, we should have environment variables in shell config (e.g. zshrc) even if not installed it yet or failed to install it. But thanks to afx, afx users can keep it with same files and enable it only while a package is installed.
64
64
@@ -88,9 +88,9 @@ list | no
88
88
89
89
### snippet
90
90
91
-
Type | Required
91
+
Type | Default
92
92
---|---
93
-
string | no
93
+
string | `""`
94
94
95
95
`snippet` allows you to specify the command which are runned when starting new shell.
96
96
@@ -114,9 +114,9 @@ string | no
114
114
115
115
### snippet-prepare (beta)
116
116
117
-
Type | Required
117
+
Type | Default
118
118
---|---
119
-
string | no
119
+
string | `""`
120
120
121
121
`snippet-prepare` allows you to specify the command which are runned when starting new shell. Unlike `snippet`, this `snippet-prepare` is run before `source` command.
122
122
@@ -147,9 +147,9 @@ This option comes from https://github.com/b4b4r07/afx/issues/6.
147
147
148
148
### if
149
149
150
-
Type | Required
150
+
Type | Default
151
151
---|---
152
-
string | no
152
+
string | `""`
153
153
154
154
`if` allows you to specify the condition to load packages. If it returns true, then the plugin will be loaded. But if it returns false, the plugin will not be loaded.
0 commit comments