Skip to content

Conversation

@DannyBen
Copy link
Member

@DannyBen DannyBen commented Dec 5, 2025

This PR moves the global variables declarations after the environment_variables declarations.

This is designed to allow populating global variables with values from environment variables, after they were handled by the bashly initialization process.

For example:

# bashly.yml
environment_variables:
- name: cli_config_file
  help: Path to config file
  default: config.yaml

variables:
- name: config_file
  value: $CLI_CONFIG_FILE

will now work, and generate this snippet in initialize():

export CLI_CONFIG_FILE="${CLI_CONFIG_FILE:-config.yaml}"
declare -g config_file="$CLI_CONFIG_FILE"

From this point on, this behavior is guaranteed using a fixture test.

@DannyBen DannyBen merged commit d663616 into master Dec 5, 2025
7 checks passed
@DannyBen DannyBen deleted the update/var-order branch December 5, 2025 13:09
@DannyBen DannyBen added this to the 1.3.5 milestone Dec 5, 2025
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