From 5d1d4a9d708bf5345365ee160f4a784dd5d713cf Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Thu, 31 Oct 2024 08:01:19 +0000 Subject: [PATCH 1/4] changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c84fa39..e61a6816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ Changelog ======================================== +v1.2.4 - 2024-10-31 +---------------------------------------- + +- Add `command.variables` as a convenience utility for defining global command variables [`6538886`](https://github.com/DannyBen/bashly/commit/6538886) +- Update JSON schema to include `command.variables` [`28953fb`](https://github.com/DannyBen/bashly/commit/28953fb) +- Refactor `command.variables` to a new `Variable` object [`3e5a060`](https://github.com/DannyBen/bashly/commit/3e5a060) +- Add black and white to color library [`0573e0f`](https://github.com/DannyBen/bashly/commit/0573e0f) +- Compare [`v1.2.3..v1.2.4`](https://github.com/dannyben/bashly/compare/v1.2.3..v1.2.4) + + v1.2.3 - 2024-10-16 ---------------------------------------- From f76c53b63e63b4a0f24328a6053d4d74b9edbf3c Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Fri, 1 Nov 2024 03:47:30 +0000 Subject: [PATCH 2/4] - Move root variables from `run()` to `initialize()` --- examples/render-mandoc/docs/download.1 | 2 +- examples/render-mandoc/docs/download.md | 2 +- lib/bashly/views/command/function.gtx | 2 +- lib/bashly/views/command/initialize.gtx | 1 + lib/bashly/views/command/run.gtx | 1 - lib/bashly/views/command/variables.gtx | 10 ++++++---- spec/approvals/examples/render-mandoc | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) 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..753ad26c 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) From 478ead4125a26a38133b0461e6b4e8d97a921f08 Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Fri, 1 Nov 2024 03:50:46 +0000 Subject: [PATCH 3/4] remove redundant safe operator in variables template --- lib/bashly/views/command/variables.gtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bashly/views/command/variables.gtx b/lib/bashly/views/command/variables.gtx index 753ad26c..c6c53cee 100644 --- a/lib/bashly/views/command/variables.gtx +++ b/lib/bashly/views/command/variables.gtx @@ -1,4 +1,4 @@ -if variables&.any? +if variables.any? = view_marker variables.each do |var| From 6aaa3bc2f5d7522308af67e43f9f4efe059ae0ca Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Fri, 1 Nov 2024 09:33:21 +0000 Subject: [PATCH 4/4] version bump 1.2.5 --- Dockerfile | 2 +- lib/bashly/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1eb2942b..ff91ef98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM dannyben/alpine-ruby:3.3.3 ENV PS1="\n\n>> bashly \W \$ " -ENV BASHLY_VERSION=1.2.4 +ENV BASHLY_VERSION=1.2.5 WORKDIR /app diff --git a/lib/bashly/version.rb b/lib/bashly/version.rb index 0764bd0f..7ca4fec1 100644 --- a/lib/bashly/version.rb +++ b/lib/bashly/version.rb @@ -1,3 +1,3 @@ module Bashly - VERSION = '1.2.4' + VERSION = '1.2.5' end