Skip to content

Commit cc5a29d

Browse files
committed
- Move global variable declarations after environment variable declarations
1 parent b95a0a9 commit cc5a29d

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed

lib/bashly/views/command/initialize.gtx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
if root_command?
88
>
9-
= render(:variables).indent(2)
109
= render(:environment_variables_default).indent 2
10+
= render(:variables).indent(2)
1111
end
1212

1313
if user_file_exist?('initialize')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cli
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This fixture ensures that environment varaibles are declared and populated
2+
begore variables defined in bashly.yml, to allow using the values from them
3+
in the variables.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: cli
2+
help: Ensure env var / var order
3+
version: 0.1.0
4+
5+
environment_variables:
6+
- name: cli_config_file
7+
help: Path to config file
8+
default: config.yaml
9+
10+
variables:
11+
- name: config_file
12+
value: $CLI_CONFIG_FILE
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inspect_args
2+
echo "\$config_file == \$CLI_CONFIG_FILE == $config_file"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
bundle exec bashly generate
6+
./cli

0 commit comments

Comments
 (0)