Skip to content

Commit 947418f

Browse files
authored
Merge pull request #568 from DannyBen/update/global-variables-location
Move root variables from `run()` to `initialize()`
2 parents 5d1d4a9 + 478ead4 commit 947418f

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

examples/render-mandoc/docs/download.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 3.2
22
.\"
3-
.TH "download" "1" "October 2024" "Version 0.1.0" "Sample application"
3+
.TH "download" "1" "November 2024" "Version 0.1.0" "Sample application"
44
.SH NAME
55
\f[B]download\f[R] \- Sample application
66
.SH SYNOPSIS

examples/render-mandoc/docs/download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% download(1) Version 0.1.0 | Sample application
22
% Lana Lang
3-
% October 2024
3+
% November 2024
44

55
NAME
66
==================================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= view_marker
22

33
> {{ function_name }}_command() {
4-
= render(:variables).indent(2) if variables&.any?
4+
= render(:variables).indent(2)
55
= load_user_file(filename).indent 2
66
> }
77
>

lib/bashly/views/command/initialize.gtx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
if root_command?
99
>
10+
= render(:variables).indent(2)
1011
= render(:environment_variables_default).indent 2
1112
end
1213

lib/bashly/views/command/run.gtx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
if has_unique_args_or_flags?
1010
> declare -A unique_lookup=()
1111
end
12-
= render(:variables).indent(2) if variables&.any?
1312
> normalize_input "$@"
1413
> parse_requirements "${input[@]}"
1514
if user_file_exist?('before')
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
= view_marker
1+
if variables.any?
2+
= view_marker
23

3-
variables.each do |var|
4-
= var.render(:definition)
5-
end
4+
variables.each do |var|
5+
= var.render(:definition)
6+
end
7+
end

spec/approvals/examples/render-mandoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ ISSUE TRACKER
4444
AUTHORS
4545
Lana Lang.
4646

47-
Version 0.1.0 October 2024 download(1)
47+
Version 0.1.0 November 2024 download(1)

0 commit comments

Comments
 (0)