Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions schemas/bashly.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,50 @@
},
"additionalProperties": false
},
"variable": {
"title": "variable",
"description": "A global bash variable\nhttps://bashly.dannyb.co/configuration/command/#variables",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"title": "name",
"description": "A name for the current variable",
"type": "string",
"minLength": 1,
"examples": [
"output_dir"
]
},
"value": {
"title": "value",
"description": "A value for the current variable",
"examples": [
"output_dir",
[
"development",
"production"
],
{
"verbosity": 3,
"debug": true
}
]
}
},
"patternProperties": {
"^x_.": {
"title": "custom property",
"description": "A custom property of any type",
"examples": [
"Anything"
]
}
},
"additionalProperties": false
},
"name-property": {
"title": "name",
"description": "A name of the current script or sub-command\nhttps://bashly.dannyb.co/configuration/command/#name",
Expand Down Expand Up @@ -490,6 +534,15 @@
"$ref": "#/definitions/environment-variable"
}
},
"variables-property": {
"title": "variables",
"description": "Bash variables for the current application\nhttps://bashly.dannyb.co/configuration/command/#variables",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/variable"
}
},
"examples-property": {
"title": "examples",
"oneOf": [
Expand Down Expand Up @@ -806,6 +859,9 @@
"environment_variables": {
"$ref": "#/definitions/environment-variables-property"
},
"variables": {
"$ref": "#/definitions/variables-property"
},
"examples": {
"$ref": "#/definitions/examples-property"
},
Expand Down Expand Up @@ -880,6 +936,9 @@
"environment_variables": {
"$ref": "#/definitions/environment-variables-property"
},
"variables": {
"$ref": "#/definitions/variables-property"
},
"examples": {
"$ref": "#/definitions/examples-property"
},
Expand Down
38 changes: 38 additions & 0 deletions support/schema/bashly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,31 @@ definitions:
- ~/config.ini
patternProperties: *custom-properties
additionalProperties: false
variable:
title: variable
description: |-
A global bash variable
https://bashly.dannyb.co/configuration/command/#variables
type: object
required:
- name
properties:
name:
title: name
description: A name for the current variable
type: string
minLength: 1
examples:
- output_dir
value:
title: value
description: A value for the current variable
examples:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the variable value is null ? Is it an error? What it corresponds to in Bash (in the context of Bashly) if it's not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is allowed (it will be null if not provided), and the bash variable definition will simply be varname="".

- output_dir
- [development, production]
- { verbosity: 3, debug: true }
patternProperties: *custom-properties
additionalProperties: false
name-property:
title: name
description: |-
Expand Down Expand Up @@ -435,6 +460,15 @@ definitions:
uniqueItems: true
items:
$ref: '#/definitions/environment-variable'
variables-property:
title: variables
description: |-
Bash variables for the current application
https://bashly.dannyb.co/configuration/command/#variables
type: array
uniqueItems: true
Copy link
Collaborator

@EmilyGraceSeville7cf EmilyGraceSeville7cf Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add minItems: 1. It is the matter of the answer to the following question: Should we remind the user that something is expected in an array of let it go (if an empty array is not an error in config)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added minItems: 1 and updated some other arrays that had minLength instead of minItems.

items:
$ref: '#/definitions/variable'
examples-property:
title: examples
oneOf:
Expand Down Expand Up @@ -708,6 +742,8 @@ definitions:
$ref: '#/definitions/sub-command-default-property'
environment_variables:
$ref: '#/definitions/environment-variables-property'
variables:
$ref: '#/definitions/variables-property'
examples:
$ref: '#/definitions/examples-property'
footer:
Expand Down Expand Up @@ -754,6 +790,8 @@ properties:
$ref: '#/definitions/root-version-property'
environment_variables:
$ref: '#/definitions/environment-variables-property'
variables:
$ref: '#/definitions/variables-property'
examples:
$ref: '#/definitions/examples-property'
footer:
Expand Down