Skip to content

Commit

Permalink
- Update inspect_args to also print managed environment_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Dec 22, 2023
1 parent 6efc553 commit 4fe17b7
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/bashly/views/command/inspect_args.gtx
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@
> for k in "${sorted_keys[@]}"; do echo "- \${deps[$k]} = ${deps[$k]}"; done
> fi
>
if environment_variables.any?
> echo
> echo environment variables:
environment_variables.each do |env_var|
> echo "- \${{ env_var.name.upcase }} = ${<%= env_var.name.upcase %>:-unset}"
end
>
end
> }
>
6 changes: 6 additions & 0 deletions spec/approvals/examples/command-aliases
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ Examples:
# you can edit it freely and regenerate (it will not be overwritten)
args:
- ${args[source]} = somefile

environment variables:
- $API_KEY = unset
+ ./cli upload --help
cli upload - Upload a file

Expand Down Expand Up @@ -119,3 +122,6 @@ Examples:
# you can edit it freely and regenerate (it will not be overwritten)
args:
- ${args[source]} = somefile

environment variables:
- $API_KEY = unset
6 changes: 6 additions & 0 deletions spec/approvals/examples/commands
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ args:
- ${args[--force]} = 1
- ${args[source]} = sourcefile
- ${args[target]} = targetfile

environment variables:
- $API_KEY = unset
+ ./cli upload --help
cli upload - Upload a file

Expand Down Expand Up @@ -115,3 +118,6 @@ missing required flag: --user, -u USER
args:
- ${args[source]} = sourcefile
- ${args[--user]} = username

environment variables:
- $API_KEY = unset
6 changes: 6 additions & 0 deletions spec/approvals/examples/environment-variables
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ missing required environment variable: MY_SECRET
# code for 'cli verify' goes here
# you can edit it freely and regenerate (it will not be overwritten)
args: none

environment variables:
- $API_KEY = unset
environment:
- API_KEY=
- ENVIRONMENT=development
Expand All @@ -76,6 +79,9 @@ environment:
# code for 'cli verify' goes here
# you can edit it freely and regenerate (it will not be overwritten)
args: none

environment variables:
- $API_KEY = unset
environment:
- API_KEY=
- ENVIRONMENT=production
Expand Down
3 changes: 3 additions & 0 deletions spec/approvals/examples/multiline
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Examples:
# code for 'multi multiline' goes here
# you can edit it freely and regenerate (it will not be overwritten)
args: none

environment variables:
- $MULTI_VITAMIN = unset
+ ./multi multiline -h
multi multiline

Expand Down
4 changes: 4 additions & 0 deletions spec/approvals/fixtures/environment-variables-initialize
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ PASS: NESTED_VAR is empty
# you can edit it freely and regenerate (it will not be overwritten)
args:
- ${args[source]} = source

environment variables:
- $API_KEY = must-be-available-in-initialize
- $CONFIG_PATH = somepath
+ export API_KEY=override-value
+ API_KEY=override-value
+ ./cli
Expand Down
3 changes: 3 additions & 0 deletions spec/approvals/fixtures/partials-extension
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ Environment Variables:
# you can edit it freely and regenerate (it will not be overwritten)
args:
- ${args[source]} = something

environment variables:
- $API_KEY = unset

0 comments on commit 4fe17b7

Please sign in to comment.