Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion lib/bashly/views/command/initialize.gtx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

if root_command?
>
= render(:variables).indent(2)
= render(:environment_variables_default).indent 2
= render(:variables).indent(2)
end

if user_file_exist?('initialize')
Expand Down
11 changes: 11 additions & 0 deletions spec/approvals/fixtures/var-order
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+ bundle exec bashly generate
creating user files in src
skipped src/root_command.sh (exists)
created ./cli
run ./cli --help to test your bash script
+ ./cli
args: none

environment variables:
- $CLI_CONFIG_FILE = config.yaml
$config_file == $CLI_CONFIG_FILE == config.yaml
1 change: 1 addition & 0 deletions spec/fixtures/workspaces/var-order/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cli
3 changes: 3 additions & 0 deletions spec/fixtures/workspaces/var-order/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This fixture ensures that environment variables are declared and populated
begore variables defined in bashly.yml, to allow using the values from them
in the variables.
12 changes: 12 additions & 0 deletions spec/fixtures/workspaces/var-order/src/bashly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: cli
help: Ensure env var / var order
version: 0.1.0

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

variables:
- name: config_file
value: $CLI_CONFIG_FILE
2 changes: 2 additions & 0 deletions spec/fixtures/workspaces/var-order/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
inspect_args
echo "\$config_file == \$CLI_CONFIG_FILE == $config_file"
6 changes: 6 additions & 0 deletions spec/fixtures/workspaces/var-order/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -x

bundle exec bashly generate
./cli