howzit 2.1.31 → 2.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/bin/howzit +1 -1
- data/lib/howzit/buildnote.rb +2 -6
- data/lib/howzit/directive.rb +19 -4
- data/lib/howzit/script_support.rb +9 -10
- data/lib/howzit/task.rb +3 -0
- data/lib/howzit/topic.rb +20 -13
- data/lib/howzit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08e8aa05598a4c02e555d78a4a12b9f7a0b767fe5fcb41c585f31d3db46ef5b1'
|
|
4
|
+
data.tar.gz: aabd6174f5693146e9995b28b86638a0992e541ad8bad7c943d1f72379bdc775
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9effb24928673466f2cadb59f93f2cac8b3df0154a982f754159b3537a4c92d995914429dd34f1831dc5e9a33d98a33af83518ace340f5b3b223a04f5c740de
|
|
7
|
+
data.tar.gz: 40aa8c9f70d76d7668fa211b9ca0fa3a694cd63ad56324d11eff5129ed0e746d777fad30b92c0dfa276f2bdf41281dbefb79d51f0cf616a4e2b3fc3571848918
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
### 2.1.33
|
|
2
|
+
|
|
3
|
+
2026-01-06 08:08
|
|
4
|
+
|
|
5
|
+
#### IMPROVED
|
|
6
|
+
|
|
7
|
+
- Variables set via set_var in run blocks are now properly substituted in all task types: fenced code blocks, @run directive actions, @copy directive actions, and @after block content, enabling dynamic script execution and messaging based on variables set in earlier tasks
|
|
8
|
+
- Directive#to_task now merges parent named_args with existing named_arguments instead of overwriting, preserving variables set by scripts via set_var helper functions across sequential task execution
|
|
9
|
+
|
|
10
|
+
#### FIXED
|
|
11
|
+
|
|
12
|
+
- Fix variables set via set_var in run blocks not being substituted in subsequent fenced code block (```run) actions by moving variable substitution to execution time instead of task creation time
|
|
13
|
+
- Fix @after blocks only displaying first two lines by wrapping each line individually to preserve multiline structure including empty lines and numbered lists
|
|
14
|
+
- Fix @after blocks not displaying when no tasks are executed in sequential processing mode by ensuring they display regardless of task execution results
|
|
15
|
+
|
|
16
|
+
### 2.1.32
|
|
17
|
+
|
|
18
|
+
2026-01-06 05:21
|
|
19
|
+
|
|
20
|
+
#### IMPROVED
|
|
21
|
+
|
|
22
|
+
- Completion output for howzit -L and howzit -T now shows topic titles without parenthetical variable names, making completion lists cleaner and easier to read while still preserving variable information in verbose output (howzit -R).
|
|
23
|
+
|
|
1
24
|
### 2.1.31
|
|
2
25
|
|
|
3
26
|
2026-01-06 04:57
|
data/bin/howzit
CHANGED
data/lib/howzit/buildnote.rb
CHANGED
|
@@ -168,9 +168,7 @@ module Howzit
|
|
|
168
168
|
##
|
|
169
169
|
def list_topics
|
|
170
170
|
@topics.map do |topic|
|
|
171
|
-
|
|
172
|
-
title += "(#{topic.named_args.keys.join(', ')})" unless topic.named_args.empty?
|
|
173
|
-
title
|
|
171
|
+
topic.title
|
|
174
172
|
end
|
|
175
173
|
end
|
|
176
174
|
|
|
@@ -195,9 +193,7 @@ module Howzit
|
|
|
195
193
|
@topics.each do |topic|
|
|
196
194
|
next unless topic.tasks.count.positive?
|
|
197
195
|
|
|
198
|
-
|
|
199
|
-
title += "(#{topic.named_args.keys.join(', ')})" unless topic.named_args.empty?
|
|
200
|
-
output.push(title)
|
|
196
|
+
output.push(topic.title)
|
|
201
197
|
end
|
|
202
198
|
output.join("\n")
|
|
203
199
|
end
|
data/lib/howzit/directive.rb
CHANGED
|
@@ -85,18 +85,30 @@ module Howzit
|
|
|
85
85
|
task_data[:log_level] = current_log_level if current_log_level && !task_data[:log_level]
|
|
86
86
|
|
|
87
87
|
# Set named_arguments before processing titles for variable substitution
|
|
88
|
-
|
|
88
|
+
# Merge with existing named_arguments to preserve variables set by scripts
|
|
89
|
+
Howzit.named_arguments ||= {}
|
|
90
|
+
Howzit.named_arguments.merge!(parent.named_args) if parent.named_args
|
|
89
91
|
|
|
90
92
|
case task_type
|
|
91
93
|
when :block
|
|
92
|
-
# Block tasks
|
|
94
|
+
# Block tasks need title rendering
|
|
95
|
+
# Note: Action substitution happens at execution time in Task#run_block
|
|
96
|
+
# so variables from previous run blocks are available
|
|
97
|
+
title = task_data[:title]
|
|
98
|
+
title = title.render_arguments if title && !title.empty?
|
|
99
|
+
task_data[:title] = title
|
|
100
|
+
# Don't substitute variables in action here - do it at execution time
|
|
93
101
|
task_data[:parent] = parent
|
|
94
102
|
Howzit::Task.new(task_data, optional: @optional, default: @default)
|
|
95
103
|
when :run
|
|
96
|
-
# Run tasks need title rendering (similar to define_task_args)
|
|
104
|
+
# Run tasks need title and action rendering (similar to define_task_args)
|
|
97
105
|
title = task_data[:title]
|
|
98
106
|
title = title.render_arguments if title && !title.empty?
|
|
99
107
|
task_data[:title] = title
|
|
108
|
+
# Apply variable substitution to action
|
|
109
|
+
action = task_data[:action]
|
|
110
|
+
action = action.render_arguments if action && !action.empty?
|
|
111
|
+
task_data[:action] = action
|
|
100
112
|
task_data[:parent] = parent
|
|
101
113
|
Howzit::Task.new(task_data, optional: @optional, default: @default)
|
|
102
114
|
when :copy
|
|
@@ -104,7 +116,10 @@ module Howzit
|
|
|
104
116
|
title = task_data[:title]
|
|
105
117
|
title = title.render_arguments if title && !title.empty?
|
|
106
118
|
task_data[:title] = title
|
|
107
|
-
|
|
119
|
+
# Apply variable substitution to action before escaping
|
|
120
|
+
action = task_data[:action]
|
|
121
|
+
action = action.render_arguments if action && !action.empty?
|
|
122
|
+
task_data[:action] = Shellwords.escape(action)
|
|
108
123
|
task_data[:parent] = parent
|
|
109
124
|
Howzit::Task.new(task_data, optional: @optional, default: @default)
|
|
110
125
|
when :open
|
|
@@ -34,7 +34,7 @@ module Howzit
|
|
|
34
34
|
def ensure_support_dir
|
|
35
35
|
dir = support_dir
|
|
36
36
|
legacy_dir = File.expand_path(LEGACY_SUPPORT_DIR)
|
|
37
|
-
|
|
37
|
+
File.expand_path(File.join(SUPPORT_DIR, '..'))
|
|
38
38
|
|
|
39
39
|
# If legacy files exist, always offer to migrate them before proceeding.
|
|
40
40
|
# Use early_init=false here since config is already loaded by the time we reach this point
|
|
@@ -71,15 +71,14 @@ module Howzit
|
|
|
71
71
|
##
|
|
72
72
|
def migrate_legacy_support(early_init: false)
|
|
73
73
|
legacy_dir = File.expand_path(LEGACY_SUPPORT_DIR)
|
|
74
|
-
new_root
|
|
74
|
+
new_root = File.expand_path(File.join(SUPPORT_DIR, '..'))
|
|
75
75
|
|
|
76
76
|
unless File.directory?(legacy_dir)
|
|
77
|
-
if early_init
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
end
|
|
77
|
+
return if early_init
|
|
78
|
+
|
|
79
|
+
Howzit.console.info "No legacy Howzit directory found at #{legacy_dir}; nothing to migrate."
|
|
80
|
+
return
|
|
81
|
+
|
|
83
82
|
end
|
|
84
83
|
|
|
85
84
|
prompt = "Migrate Howzit files from #{legacy_dir} to #{new_root}? This will overwrite files in the new location with legacy versions, " \
|
|
@@ -87,7 +86,7 @@ module Howzit
|
|
|
87
86
|
|
|
88
87
|
if early_init
|
|
89
88
|
unless simple_yn_prompt(prompt, default: true)
|
|
90
|
-
|
|
89
|
+
warn 'Migration cancelled; no changes made.'
|
|
91
90
|
return
|
|
92
91
|
end
|
|
93
92
|
else
|
|
@@ -117,7 +116,7 @@ module Howzit
|
|
|
117
116
|
|
|
118
117
|
FileUtils.rm_rf(legacy_dir)
|
|
119
118
|
if early_init
|
|
120
|
-
|
|
119
|
+
warn "Migrated Howzit files from #{legacy_dir} to #{new_root}."
|
|
121
120
|
else
|
|
122
121
|
Howzit.console.info "Migrated Howzit files from #{legacy_dir} to #{new_root}."
|
|
123
122
|
end
|
data/lib/howzit/task.rb
CHANGED
|
@@ -62,6 +62,9 @@ module Howzit
|
|
|
62
62
|
def run_block
|
|
63
63
|
Howzit.console.info "#{@prefix}{bg}Running block {bw}#{@title}{x}".c if Howzit.options[:log_level] < 2
|
|
64
64
|
block = @action
|
|
65
|
+
# Apply variable substitution to block content at execution time
|
|
66
|
+
# (variables from previous run blocks are now available)
|
|
67
|
+
block = block.render_arguments if block && !block.empty?
|
|
65
68
|
script = Tempfile.new('howzit_script')
|
|
66
69
|
comm_file = ScriptComm.setup
|
|
67
70
|
old_log_level = apply_log_level
|
data/lib/howzit/topic.rb
CHANGED
|
@@ -141,7 +141,10 @@ module Howzit
|
|
|
141
141
|
|
|
142
142
|
unless @postreqs.empty?
|
|
143
143
|
begin
|
|
144
|
-
|
|
144
|
+
# Apply variable substitution to postreqs content, then wrap each line individually to preserve structure
|
|
145
|
+
postreqs_content = @postreqs.join("\n\n").render_arguments
|
|
146
|
+
wrapped_content = postreqs_content.split(/\n/).map { |line| line.wrap(cols - 4) }.join("\n")
|
|
147
|
+
puts TTY::Box.frame("{bw}#{wrapped_content}{x}".c, width: cols)
|
|
145
148
|
rescue Errno::EPIPE
|
|
146
149
|
# Pipe closed, ignore
|
|
147
150
|
end
|
|
@@ -859,21 +862,25 @@ module Howzit
|
|
|
859
862
|
re_evaluate_conditionals(conditional_state, directive_index - 1, context)
|
|
860
863
|
end
|
|
861
864
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
865
|
+
if @results[:total].positive?
|
|
866
|
+
total = "{bw}#{@results[:total]}{by} #{@results[:total] == 1 ? 'task' : 'tasks'}".c
|
|
867
|
+
errors = "{bw}#{@results[:errors]}{by} #{@results[:errors] == 1 ? 'error' : 'errors'}".c
|
|
868
|
+
@results[:message] += if @results[:errors].zero?
|
|
869
|
+
"{bg}\u{2713} {by}Ran #{total}{x}".c
|
|
870
|
+
elsif Howzit.options[:force]
|
|
871
|
+
"{br}\u{2715} {by}Completed #{total} with #{errors}{x}".c
|
|
872
|
+
else
|
|
873
|
+
"{br}\u{2715} {by}Ran #{total}, terminated due to error{x}".c
|
|
874
|
+
end
|
|
875
|
+
output.push(@results[:message]) if Howzit.options[:log_level] < 2 && !nested && !Howzit.options[:run]
|
|
876
|
+
end
|
|
873
877
|
|
|
874
878
|
unless @postreqs.empty?
|
|
875
879
|
begin
|
|
876
|
-
|
|
880
|
+
# Apply variable substitution to postreqs content, then wrap each line individually to preserve structure
|
|
881
|
+
postreqs_content = @postreqs.join("\n\n").render_arguments
|
|
882
|
+
wrapped_content = postreqs_content.split(/\n/).map { |line| line.wrap(cols - 4) }.join("\n")
|
|
883
|
+
puts TTY::Box.frame("{bw}#{wrapped_content}{x}".c, width: cols)
|
|
877
884
|
rescue Errno::EPIPE
|
|
878
885
|
# Pipe closed, ignore
|
|
879
886
|
end
|
data/lib/howzit/version.rb
CHANGED