diff --git a/examples/render-mandoc/docs/download.1 b/examples/render-mandoc/docs/download.1 index 9f75126e..f600827e 100644 --- a/examples/render-mandoc/docs/download.1 +++ b/examples/render-mandoc/docs/download.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.2 .\" -.TH "download" "1" "October 2024" "Version 0.1.0" "Sample application" +.TH "download" "1" "November 2024" "Version 0.1.0" "Sample application" .SH NAME \f[B]download\f[R] \- Sample application .SH SYNOPSIS diff --git a/examples/render-mandoc/docs/download.md b/examples/render-mandoc/docs/download.md index bec7a9c5..99c93073 100644 --- a/examples/render-mandoc/docs/download.md +++ b/examples/render-mandoc/docs/download.md @@ -1,6 +1,6 @@ % download(1) Version 0.1.0 | Sample application % Lana Lang -% October 2024 +% November 2024 NAME ================================================== diff --git a/lib/bashly/views/command/function.gtx b/lib/bashly/views/command/function.gtx index 1e91fab0..00bfd52d 100644 --- a/lib/bashly/views/command/function.gtx +++ b/lib/bashly/views/command/function.gtx @@ -1,7 +1,7 @@ = view_marker > {{ function_name }}_command() { -= render(:variables).indent(2) if variables&.any? += render(:variables).indent(2) = load_user_file(filename).indent 2 > } > diff --git a/lib/bashly/views/command/initialize.gtx b/lib/bashly/views/command/initialize.gtx index 2ae837fd..3be382b4 100644 --- a/lib/bashly/views/command/initialize.gtx +++ b/lib/bashly/views/command/initialize.gtx @@ -7,6 +7,7 @@ if root_command? > + = render(:variables).indent(2) = render(:environment_variables_default).indent 2 end diff --git a/lib/bashly/views/command/run.gtx b/lib/bashly/views/command/run.gtx index e3af52c4..8dda6762 100644 --- a/lib/bashly/views/command/run.gtx +++ b/lib/bashly/views/command/run.gtx @@ -9,7 +9,6 @@ if has_unique_args_or_flags? > declare -A unique_lookup=() end -= render(:variables).indent(2) if variables&.any? > normalize_input "$@" > parse_requirements "${input[@]}" if user_file_exist?('before') diff --git a/lib/bashly/views/command/variables.gtx b/lib/bashly/views/command/variables.gtx index 2c28db56..c6c53cee 100644 --- a/lib/bashly/views/command/variables.gtx +++ b/lib/bashly/views/command/variables.gtx @@ -1,5 +1,7 @@ -= view_marker +if variables.any? + = view_marker -variables.each do |var| - = var.render(:definition) -end + variables.each do |var| + = var.render(:definition) + end +end \ No newline at end of file diff --git a/spec/approvals/examples/render-mandoc b/spec/approvals/examples/render-mandoc index ca383f90..5c3d0ca3 100644 --- a/spec/approvals/examples/render-mandoc +++ b/spec/approvals/examples/render-mandoc @@ -44,4 +44,4 @@ ISSUE TRACKER AUTHORS Lana Lang. -Version 0.1.0 October 2024 download(1) +Version 0.1.0 November 2024 download(1)