Skip to content

Conversation

DannyBen
Copy link
Member

@DannyBen DannyBen commented Oct 22, 2024

Update schema for #563

@DannyBen
Copy link
Member Author

@EmilyGraceSeville7cf, I have added a new possible value for command called variables.

It is an array of dictionaries, and each item must have a name and an optional value. The value can be pretty much anything:

    variables:
    # Simple value
    - name: output_folder
      value: output

    # Array
    - name: download_sources
      value:
      - youtube
      - instagram

    # Associative array
    - name: zip_options
      value:
        pattern: "*.json"
        compression_level: fast

So I did not limit the value to any particular type.
Note that bashly.json schema is auto-generated from the bashly.yaml schema.

Your approval por favor.

Copy link
Collaborator

@EmilyGraceSeville7cf EmilyGraceSeville7cf left a comment

Choose a reason for hiding this comment

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

LGTM, just have some questions and comments 😄

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.

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="".

@DannyBen
Copy link
Member Author

Thanks @EmilyGraceSeville7cf - merging.

@DannyBen DannyBen merged commit b61600d into master Oct 22, 2024
8 checks passed
@DannyBen DannyBen deleted the update/schema branch October 22, 2024 16:52
@DannyBen DannyBen added this to the 1.2.4 milestone Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants