Skip to content

Commit a46e86b

Browse files
committed
update terminal docs and schema for command.variables
1 parent 1efd806 commit a46e86b

File tree

6 files changed

+125
-11
lines changed

6 files changed

+125
-11
lines changed

lib/bashly/docs/command.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ command.private:
310310
private: true
311311
312312
command.variables:
313-
help: Define a list of global bash variables.
313+
help: Define a list of global bash variables. See `variable` for reference.
314314
url: https://bashly.dannyb.co/configuration/command/#variables
315315
example: |-
316316
variables:
@@ -330,7 +330,6 @@ command.variables:
330330
pattern: "*.json"
331331
compression_level: fast
332332
333-
334333
command.version:
335334
help: Specify the version to show when running with `--version`.
336335
url: https://bashly.dannyb.co/configuration/command/#version

lib/bashly/docs/var.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
variable:
2+
help: Define variables that will be available to your script.
3+
url: https://bashly.dannyb.co/configuration/variable/
4+
example: |-
5+
variables:
6+
# Simple value
7+
- name: output_folder
8+
value: output
9+
10+
# Array
11+
- name: download_sources
12+
value:
13+
- youtube
14+
- instagram
15+
16+
# Associative array
17+
- name: zip_options
18+
value:
19+
pattern: "*.json"
20+
compression_level: fast
21+
22+
variable.name:
23+
help: Specify the name of the variable.
24+
url: https://bashly.dannyb.co/configuration/variable/#name
25+
example: |-
26+
variables:
27+
- name: output_folder
28+
value: output
29+
30+
variable.value:
31+
help: |-
32+
Specify the value for this variable.
33+
This can be any value type, including array and hash (associative array).
34+
url: https://bashly.dannyb.co/configuration/variable/#value
35+
example: |-
36+
variables:
37+
# Simple value
38+
- name: output_folder
39+
value: output
40+
41+
# Array
42+
- name: download_sources
43+
value:
44+
- youtube
45+
- instagram
46+
47+
# Associative array
48+
- name: zip_options
49+
value:
50+
pattern: "*.json"
51+
compression_level: fast

schemas/bashly.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@
382382
},
383383
"variable": {
384384
"title": "variable",
385-
"description": "A global bash variable\nhttps://bashly.dannyb.co/configuration/command/#variables",
385+
"description": "A global bash variable\nhttps://bashly.dannyb.co/configuration/variable/#variable",
386386
"type": "object",
387387
"required": [
388388
"name"
389389
],
390390
"properties": {
391391
"name": {
392392
"title": "name",
393-
"description": "A name for the current variable",
393+
"description": "A name for the current variable\nhttps://bashly.dannyb.co/configuration/variable/#name",
394394
"type": "string",
395395
"minLength": 1,
396396
"examples": [
@@ -399,9 +399,9 @@
399399
},
400400
"value": {
401401
"title": "value",
402-
"description": "A value for the current variable",
402+
"description": "A value for the current variable\nhttps://bashly.dannyb.co/configuration/variable/#value",
403403
"examples": [
404-
"output_dir",
404+
"./output",
405405
[
406406
"development",
407407
"production"

spec/approvals/cli/doc/full

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ command.private
469469

470470
command.variables
471471

472-
Define a list of global bash variables.
472+
Define a list of global bash variables. See variable for reference.
473473

474474
variables:
475475
# Simple value
@@ -824,3 +824,60 @@ flag.validate
824824

825825
See https://bashly.dannyb.co/configuration/flag/#validate
826826

827+
variable
828+
829+
Define variables that will be available to your script.
830+
831+
variables:
832+
# Simple value
833+
- name: output_folder
834+
value: output
835+
836+
# Array
837+
- name: download_sources
838+
value:
839+
- youtube
840+
- instagram
841+
842+
# Associative array
843+
- name: zip_options
844+
value:
845+
pattern: "*.json"
846+
compression_level: fast
847+
848+
See https://bashly.dannyb.co/configuration/variable/
849+
850+
variable.name
851+
852+
Specify the name of the variable.
853+
854+
variables:
855+
- name: output_folder
856+
value: output
857+
858+
See https://bashly.dannyb.co/configuration/variable/#name
859+
860+
variable.value
861+
862+
Specify the value for this variable.
863+
This can be any value type, including array and hash (associative array).
864+
865+
variables:
866+
# Simple value
867+
- name: output_folder
868+
value: output
869+
870+
# Array
871+
- name: download_sources
872+
value:
873+
- youtube
874+
- instagram
875+
876+
# Associative array
877+
- name: zip_options
878+
value:
879+
pattern: "*.json"
880+
compression_level: fast
881+
882+
See https://bashly.dannyb.co/configuration/variable/#value
883+

spec/approvals/cli/doc/index

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ flag.required
5151
flag.short
5252
flag.unique
5353
flag.validate
54+
variable
55+
variable.name
56+
variable.value

support/schema/bashly.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,23 +339,27 @@ definitions:
339339
title: variable
340340
description: |-
341341
A global bash variable
342-
https://bashly.dannyb.co/configuration/command/#variables
342+
https://bashly.dannyb.co/configuration/variable/#variable
343343
type: object
344344
required:
345345
- name
346346
properties:
347347
name:
348348
title: name
349-
description: A name for the current variable
349+
description: |-
350+
A name for the current variable
351+
https://bashly.dannyb.co/configuration/variable/#name
350352
type: string
351353
minLength: 1
352354
examples:
353355
- output_dir
354356
value:
355357
title: value
356-
description: A value for the current variable
358+
description: |-
359+
A value for the current variable
360+
https://bashly.dannyb.co/configuration/variable/#value
357361
examples:
358-
- output_dir
362+
- ./output
359363
- [development, production]
360364
- { verbosity: 3, debug: true }
361365
patternProperties: *custom-properties

0 commit comments

Comments
 (0)